473,657 Members | 2,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 11502
"Daniel Knöpfel" <dd****@iphch.c hwrote in message
news:uL******** ******@TK2MSFTN GP04.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.csp roj


Jan 10 '07 #2
Hi

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

MSBuild %~dp0Applicatio n\web.net\v4.03 .01\eOurProject .proj
/p:AllowUnsafeBl ocks=true;Outpu tDir=%~f1;Tasks Dir=%~dp0;Confi gPath=%~f2;Conf igurationMode=% MODE%
/l:FileLogger,Mi crosoft.Build.E ngine;logfile=% ~dp0\eOurProjec t.log
Regards

Daniel
"Daniel Knöpfel" <dd****@iphch.c hwrote in message
news:uL******** ******@TK2MSFTN GP04.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
1362
by: jojobar | last post by:
In vs.net 2005 you can build the entire website, entire solution or a single page. The project I am working on has more than 1000 pages spread over 50-60 directories. We work on one or two of the directories most of the time. When an external dependency is changed (say a function in business layer), we have to compile the entire web project, which takes a lot of time because vs.net compiles all 60 directories. What is need is an option...
13
5052
by: Dave Booker | last post by:
I need to compile a VS2005 project to run using the 1.1 framework (i.e., app.config containing <supportedRuntime version="v1.1.4322" /> ). (If I just compile and run with such a setting it functions, but I can't tell which framework it's using.) Is there any way to specifically compile for 1.1 with the standard Studio, or do I have to seek recourse with plug-ins like the following? ...
2
1557
by: bep | last post by:
I have a couple of web sites, some web services and some windows services that I need to deploy to our production servers. We used to use NANT with the VS 2003 applications. Now that we are using VS 2005, I am looking at all available deployment options. So far, I see: 1) NANT 2) MSBuild 3) Web Deployment Projects (built on MSBuild) 4) Custom powershell scripts 5) VS.Net 2005 Team System, Developer edition (Handles build only, not
3
9755
by: rockdale | last post by:
Hi, all Could somebody tells me where can I set "Allow unsafe code" in visual studio 2005. I could not find any Project Properties|Configuration Properties in my website solution. Mine appl is a VS 2005 Web Site Projects, should I migrate to VS 2005 Web Application Projects? Thanks a lot
0
2532
by: Pucca | last post by:
Hi I'm using vs2005. I am getting a bunch of compiler warnings after I made some changes to my code that was compiling clean. I'm also getting memory errors when I run my program and it's pinvoking some C++ code, which was working also fine before. I wonder if these warning are causing the problem. I would appreciate some help or suggestions on how to correct these. Thanks. Warning 37 At least one of the arguments for...
0
1176
by: Karel Kral | last post by:
Hello, I have medium-sized solution in VB.NET (70 000 lines). The project compiles ok under VS2005, without any errors, without any warnings. But when I compile the same solution under MSBuild (from command line), strange things happenes. Compiler executed by MsBuild reports unknown types where it should by known. After whole day of investigation is have found, that imported namespaces are randomly "lost".
3
2032
by: Patrice | last post by:
Hi all, I'm currently upgrading a 1.1 application. We were using a command file to invoke the command line compiler to that we have the code behind compiled into multiple DLLs (to be able to deploy one "part" of the site while working on another, this is an intranet that contains related but somewhat independant "modules"). I first thought it was possible in 2.0 but it seems now that actually this is only true for ASPX files and that...
5
6098
by: Andy | last post by:
Hi, I have a question... I have some code which has an unsafe block in it. In VS2008 (Framework 3.5), i go to the project property and check the box that allows unsafe blocks. The code compiles fine. On my build server though, things are not happy. The error seems to be that /unsafe needs to be set as a command line option, even though MSBuild is being used.
0
1549
by: bpulimal | last post by:
We have a build machine that gets files for MSBuild from source control (SourceGear Vault). Occasionally, developers check in components and later decide to exclude those components from Visual Studio project. When build process gets the latest from source control, these excluded files also will get picked up. This causes a problem to the build process. MSBuild fails saying that it ‘could not load type (removed component). I believe MSBuild...
0
8420
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8842
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8740
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8516
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.