469,304 Members | 2,018 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,304 developers. It's quick & easy.

Compiling .Net application with unsafe code using MSbuild

Hi all

I need to adapt an Msbuild script to compile a visual studio 2005 solution
(including several projects and a website). The application is written in C#
and using .NET 2.0. Due to late changes the application uses unsafe code in
one project. Compiling in VS 2005 is no problem, however the build script
that we used no longer works. Unfortunately i dont not have any experience
in making build scripts using Msbuild. How does one add a compileroption
such as /unsafe? The msbuild description in msdn does not explicitly explain
this.

Thanks for any help

Greetings
Jan 10 '07 #1
2 11160
"Daniel Knöpfel" <dd****@iphch.chwrote in message
news:uL**************@TK2MSFTNGP04.phx.gbl...
Hi all

I need to adapt an Msbuild script to compile a visual studio 2005 solution
(including several projects and a website). The application is written in
C# and using .NET 2.0. Due to late changes the application uses unsafe
code in one project. Compiling in VS 2005 is no problem, however the build
script that we used no longer works. Unfortunately i dont not have any
experience in making build scripts using Msbuild. How does one add a
compileroption such as /unsafe? The msbuild description in msdn does not
explicitly explain this.
The Visual Studio 2005 project IS an MSBuild script. Just open the .csproj
file in a text editor and search for "unsafe" and you'll see what was added
to enable unsafe code. Or, just do:

msbuild yourproject.csproj


Jan 10 '07 #2
Hi

We stumbled over the solution. In the call to the msbuild script, the
parameter :AllowUnsafeBlocks=true has to be passed.
Our statement to call the msbuild process would then look like this:

MSBuild %~dp0Application\web.net\v4.03.01\eOurProject.proj
/p:AllowUnsafeBlocks=true;OutputDir=%~f1;TasksDir=% ~dp0;ConfigPath=%~f2;ConfigurationMode=%MODE%
/l:FileLogger,Microsoft.Build.Engine;logfile=%~dp0\ eOurProject.log
Regards

Daniel
"Daniel Knöpfel" <dd****@iphch.chwrote in message
news:uL**************@TK2MSFTNGP04.phx.gbl...
Hi all

I need to adapt an Msbuild script to compile a visual studio 2005 solution
(including several projects and a website). The application is written in
C# and using .NET 2.0. Due to late changes the application uses unsafe
code in one project. Compiling in VS 2005 is no problem, however the build
script that we used no longer works. Unfortunately i dont not have any
experience in making build scripts using Msbuild. How does one add a
compileroption such as /unsafe? The msbuild description in msdn does not
explicitly explain this.

Thanks for any help

Greetings

Jan 10 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by jojobar | last post: by
2 posts views Thread by bep | last post: by
reply views Thread by Karel Kral | last post: by
3 posts views Thread by Patrice | last post: by
5 posts views Thread by Andy | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.