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

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.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 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>


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x