471,616 Members | 1,229 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,616 software developers and data experts.

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 11295
"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
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.