3

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.

Martin Brown
  • 24,692
  • 14
  • 77
  • 122
user707294
  • 301
  • 1
  • 7
  • 21

1 Answers1

11

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>
Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928