I have msbuild proj file which should build solution created on Visual Studio 2005 and containing both C++ and C# project
If I need to build the solution with msbuild which comes with .NET 3.5, what should be added into proj file ?
Thanks in advance
If you are trying to build a solution file which contains C++ projects then you should use devenv.exe to build it. To do this you can use the Exec task.
Sayed Ibrahim Hashimi
My Book: Inside the Microsoft Build Engine : Using MSBuild and Team Foundation Build
Related
I have build this project as .Net standard project and i am facing this error issue in jenkins when I build this project:
C:\Users\tahab.jenkins\workspace\Mondaytest\Calculator\Calculator.csproj(1,1):
error MSB4041: The default XML namespace of the pr.oject must be the
MSBuild XML namespace. If the project is authored in the MSBuild 2003
format, please add
xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the
element. If the project has been authored in the old 1.0 or
1.2 format, please convert it to MSBuild 2003 format
Make sure you use recent versions of the MSBuild task you use to build your project.
You need too use the Visual Studio 2017 (Build Tools, Full, ..) version of MSBuild - which is local to the Visual Studio installation - to build your project.
You may need to confiure the path to MSBuild, which would be - depending on the version installed on the build gent - similar to
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe
This error happens if you try to build new projects with older versions of Visual Studio / MSBuild or even with the old version of MSBuild that is part of .NET Framework.
I am trying to compile my Visual Basic .NET project named Myproject.sln via command line commands. I need to build and compile that solution.
My Visual Basic .NET compiler is called vbc.exe. Any idea how I do that thing?
I am using Visual Studio 2005 , and I have already read Microsoft's tutorial, "Building from the Command Line (Visual Basic)".
The .NET framework (version 2 and above) comes with a command line build utility called MSBuild.
You can use this to build your Visual Studio project/solution files.
From the command line:
msbuild Myproject.sln
Just run MSBuild and specify the .sln file as a command line option:
msbuild myproject.sln /p:buildmode=release
You could look at using MSBuild. That's probably the best approach.
Your .sln file is a valid MSBUild project file, so if you open the Visual Studio command prompt from the start menu and browse to your project location,
c:\...\msbuild MyFile.sln
... for example, it should just work.
I have a Dotnet Windows application built using visual studio 2015.
I am trying to automate the build using MSbuild and Jenkins.
The output files are Setup.exe & MyAppSetup.msi.
I want to use MSbuild and the VS2015 solution file, without using the VS IDE.
The Visual studio solution has 6 projects and all the projects should be built together to generate the .msi installer.
The setup.exe and .msi files are being built using the setup project file(.vdproj).
How do I build the same solution using MSBuild ?
msbuild does not have support for setup projects.
To integrate with Jenkins, you will have to use devenv (VS IDE).
Note: starting VS 2013, vdproj support is provided by an add-in.
Find more information on the following blog: https://juristr.com/blog/2014/03/Jenkins-Build-Setup-Project/
I have no problem building my VB project in both VS 2010 and 2012 againt .NET 2.0.
However, the MSBuild refuses to build it because it does not like one VB language feature introduced in VS 2010 (it is "implicit line continuation" to be more specific).
I tried the following parameters for MSBuild (from .NET 3.5):
/p:TargetFrameworkVersion=2.0
/toolsversion:3.5
This does not build as the VB feature I use have been introduced in 4.0 tools.
So I changed toolsversion to 4.0 (and using MSBuild from .NET 4.0):
/p:TargetFrameworkVersion=2.0
/toolsversion:4.0
And now MSBuild complains about another thing:
C:\Users\Libor\AppData\Local\Temp\.NETFramework,Version=2.0.AssemblyAttributes.vb(6,24):
error BC30002: Type 'System.Runtime.Versioning.TargetFrameworkAttribute' is not defined.
[project.vbproj]
The only solution now for me is to open my project in VS 2008 and manually correct the code so it is compatible with all tools. But I hope MSBuild can be configured so it builds properly, as VS can build the project against .NET 2.0, too.
Similar question and answer here. They key is going to be:
msbuild YourSolution.sln /tv:4.0 /p:TargetFrameworkVersion=v2.0
I am trying to compile my Visual Basic .NET project named Myproject.sln via command line commands. I need to build and compile that solution.
My Visual Basic .NET compiler is called vbc.exe. Any idea how I do that thing?
I am using Visual Studio 2005 , and I have already read Microsoft's tutorial, "Building from the Command Line (Visual Basic)".
The .NET framework (version 2 and above) comes with a command line build utility called MSBuild.
You can use this to build your Visual Studio project/solution files.
From the command line:
msbuild Myproject.sln
Just run MSBuild and specify the .sln file as a command line option:
msbuild myproject.sln /p:buildmode=release
You could look at using MSBuild. That's probably the best approach.
Your .sln file is a valid MSBUild project file, so if you open the Visual Studio command prompt from the start menu and browse to your project location,
c:\...\msbuild MyFile.sln
... for example, it should just work.