PDA

View Full Version : C# unsafe mode


fkish
04-06-2005, 04:57 PM
I'm trying to compile a C# sln that compiles in the IDE but not in Visual Builder.

The error message says "Unsafe code may only appear if compiled with /unsafe"

The projects are set to "Allow Unsafe Code Blocks = True"

I took a guess and added /unsafe as Option but the compiler did not like that.

Any ideas??

Thanks
Frank

kinook
04-07-2005, 07:07 AM
Not really. I doubt it's actually VBP itself causing this -- the Make VS.NET action ultimately invokes the VS.NET command-line compiler to perform an actual compile. If you check the 'Show command-line' on the Options tab, build, then copy and paste the devenv.com command-line from the build output to a Command Prompt and run it there, you should get the same behavior. You could then open a support incident with Microsoft to determine why it's doing that.

wellilein
02-21-2007, 07:57 AM
This is probably a problem of your developer.

Developers typically build Debug configurations. So when he introduced unsafe code, he switched on the [x] Allow unsafe code flag in the project properties.

What he probably didn't do is to turn that flag on for release builds.

Open MS VS, go to Project Properties / Build and have a look at the flags for different releases.

That helped me.