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

Hi, how can I use an unsafe keyword in a web application for pointers? In a Windows application, we have a setting in the project properties section in the build tag, which we can check to check the unsafe code box, but in a web application, how to allow unsafe code or any other asp.net C code to replace unsafe code (pointer) #

Thank.

+3
source share
1 answer

If this is a web application, you can simply go to the project properties and allow unsafe code, as in any standard class library. If this is a website, you can try adding the following to 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>
+11
source

All Articles