how to add unsafe keyword in web based asp.net application c#

假装没事ソ 提交于 2019-11-30 06:01:33

问题


Hi how i can use unsafe keyword in web based application for pointers? In windows application we have setting in properties section of project under build tag we can check allow unsafe code checkbox, but in web based application how to allow unsafe code or any other in replacement of unsafe code (Pointer) asp.net c#

Thank you.


回答1:


If this is a web application you can simply go to the properties of the project and allow unsafe code as you would do in any standard class library. If it is a web site you could try putting the following in your web.config:

<system.codedom>
    <compilers>
        <compiler 
            language="c#;cs;csharp" 
            extension=".cs" 
            compilerOptions="/unsafe"
            type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    </compilers>
</system.codedom>


来源:https://stackoverflow.com/questions/5867613/how-to-add-unsafe-keyword-in-web-based-asp-net-application-c-sharp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!