unsafe code compilation in Visual Studio.NET  
Author Message
matador-king





PostPosted: Visual C# IDE, unsafe code compilation in Visual Studio.NET Top

hi there !

I am extreamy new in vs.net and I can not compile the unsafe code through VS enviornment , there must be some thing for that but I dont know how

thanks




Visual C#18  
 
 
Mattias Sjogren





PostPosted: Visual C# IDE, unsafe code compilation in Visual Studio.NET Top

[Moved post to the C# IDE forum]

Yes you can enable use of unsafe code in the project properties.



 
 
Anson Horton MSFT





PostPosted: Visual C# IDE, unsafe code compilation in Visual Studio.NET Top

To add a little bit to what Mattias said, you can open the project properties by either double-clicking on the Properties node in Solution Explorer, or by right-clicking on the project and selecting properties. The option is "Allow unsafe code" and it appears on the Build tab of the properties that open (it's the 3rd checkbox on the page).

Hope that helps!
Anson



 
 
Dave_mnak





PostPosted: Visual C# IDE, unsafe code compilation in Visual Studio.NET Top

Is it possible to do this with an ASP page There is not "project properties" for ASP pages.

 
 
Mattias Sjogren





PostPosted: Visual C# IDE, unsafe code compilation in Visual Studio.NET Top

You can include /unsafe in the compilerOptions attribute in the <compiler> element in web.config.



 
 
csharprocks.com





PostPosted: Visual C# IDE, unsafe code compilation in Visual Studio.NET Top

If your relatively new , I would be very cautious using unsafe. This can result in unexpected runtime errors that won't be caught by exceptions.

Craig Maslowski, MCT