Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
730 views
in Technique[技术] by (71.8m points)

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...