I need some help from you.
In our team we want to build our .Net project in Jenkins. The project consists of subprojects that are added via the .csproj files. Now we have the problem that the Jenkins is thrown with the building of the individual subprojects due to the relative path, which is in the .sln file, following error:
MSB3202: The project file "xxxx..\xxx.csproj was not found. [C:xxxxx\x.sln]
Has anyone needed a solution like us to build our project structure to build every single project in Jenkins as a job? Or are there possible solutions for this error in Jenkins?
Thanks in advance
it s about msbuild.exe version. try to upgrade
choose upper version
Go to Manage Jenkins -> Global Tool Configuration -> MSBuild
Add upper version like this
Related
We have two build servers and a newly created project has decided that it only wants to build successfully on one of them. It gives this error on the build server on which it fails:
MyLovelyNewProject.csproj(380,11): error MSB4226: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" was not found. Also, tried to find "WebApplications\Microsoft.WebApplication.targets" in the fallback search path(s) for $(VSToolsPath) - "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0" . These search paths are defined in "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\amd64\MSBuild.exe.Config". Confirm that the path in the declaration is correct, and that the file exists on disk in one of the search paths.
Our DevOps guy investigated and determined that one server has the v15.0 build tools and one of them has the v15.9 build tools. The new project fails to build on the server that has the v15.9 build tools, since it's specifically looking for the v15.0 build tools.
All of our other projects build just fine on both build servers, but I wasn't able to find anything in their .sln or .csproj files that looked different from the new project. How can I retarget/reconfigure the new project so that it will build successfully regardless of which version of the build tools a given server has?
(If you want to suggest that DevOps synchronize the build servers to have the same version of the build tools, I agree! Alas, they're busy with a major server migration, and I would like the new project to not have a 50% chance of failing in CI while they're getting around to it.)
I think the issue is related to the Build Tool v15.9 rather than your projects. On that Server, you did not install the build workload for web projects on V15.9 Build Tool so that it cannot specify the web projects and lack the ability to build web projects. Or, the build tool is broken due to some reasons.
You could try the following steps:
1) try to open the vs_installer, click Modify
And select Web development build tools workload to install, also, if you have a asp net core web projects, do not forget to install .Net Core build tools workload.
To ensure this, I remove the web development build tools workload, and get the same issue for web project.
2) If it does not help, please click Repair for Build Tool V15.9 to repair it.
I created a Wix setup project for my .Net app (using Wix 3.11.1) with files, shortcuts, custom UI, custom action and all.
The solution itself contains a large number of .csproj-s, the Wix setup project and a Wix Custom Action project.
When I build it from Visual Studio (2010, heading towards 2017), the build seems to be correct, I get "Build succeeded".
However, my automated build script (which cleans the solution and then runs MsBuild against the solution) fails, because the Wix Setup project is built before the Custom Action project.
The custom build script is simple:
MsBuild.exe .\<solutionname>.sln /target:Rebuild /property:Configuration=<config> /property:Platform=<platform>
I tried adding a reference to the Wix setup project pointing to the CA project, hoping that the reference would tell MsBuild to build the CA project first, and then build the setup project. It didn't work.
If I run the same build script again (now the CA project having been built) the scripted build succeeds.
Can I somehow tell MsBuild to build the projects in the correct order?
I'm currently using MsBuild from .Net FW 4.0 (%windir%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe)
Any ideas?
A solution exists here (see the highest voted comment saying "It's a bug, bug, bug...".
Why does Tfs2010 build my Wix project before anything else?
In short: you need to re-order your projects in the solution file using a text editor.
I am developing simple Asp.net MVC 5 app which is working ok and visual studio 2015 can build it without any issues, but when i use MSBuild.exe command line tool it shows alot of errors which relates to typescript files compilation (primarily from node_modules folder).
I am trying to use Jenkins CI tool to automate my deployment routine, in order to do so i have to build my app using MSBuild.exe.
My project has tsconfing.json file in the root folder which contains following lines to exclude node_modules folder (it is inside #AngularComponents folder):
"exclude": [ "Scripts/**", "WrittenScripts/#AngularComponents/**" ]
But somehow MSBuild.exe command line tool just ignores it during build.
Does anyone have any ideas how to configure it to take into account my tsconfig? or tell MsBuild to not to build my node_modules folder?
Thank you in advance!
I finally figured it out.
First of all i have to use this MsBuild:
1) C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe;
Secondly, for some reason msbuild messed up my tools version 4.0 so I need to pass additional parameter to msbuild:
2) /tv:14.0
Thirdly, my typescript files have some /// references to node_modules\#types folder and for some reason it shows me any errors but not related to the reference one.
3) so i have to run npm install to recover #types packages.
After these steps msBuild builds successfully without any errors.
Thanks for all!
I have created a web solution in visual studio 2010 ,i have also created a setup project in the same solution,I have linked the two solutions by adding project output as content files.
imagine my solution name is example.sln and i have setup name as setup10
I need to build it thru command prompt.
I found in the net that i need to check the build option in configuration manager of the solution i did that.
I then used this command
msbuild example.sln
it started to create setp10.vdproj
then it failed telling that setup10.vdproj doesn't exist.
I am not able to solve this problem from a day.
kindly help me with this.
vdproj files are not supported directly by msbuild You'll have to build then by calling devenv.exe
You can add a build step to msbuild to build the vdproj with devenv. See http://thepursuitofalife.com/how-to-build-vdproj-files-in-msbuild/ for more details.
I have built an installer using WiX that consists of multiple .exe files that are 'Release' builds of other .Net projects (VS 2008). Each time I update one of the projects, I build that project and copy the Release build into the installer and then build and release the installer.
I find it a very tedious job to constantly check if the exe's that the installer has are the latest version or not. Is there a way that I can automate this build process so that as soon as I build the installer, it will generate the latest release builds of the associated projects and place the .exe file in the installer project.
I am new to VS and WiX, please advise. Thanks in advance.
You should be able to create a Solution containing:
- all projects which build the EXEs
- the installer project which builds your installer
Once you are there, you should be able to right click on the Installer Project and set dependencies to all the projects which create your EXEs. You should be able to build your Solution with the right EXEs bundled in your Installer.
Arun's solution is great idea, and I recommend it.
We also have a lot of assemblies that we maintain, and rather than copying them around we use symbolic links to minimize the number of build-and-copy actions. You can research mklink (http://en.wikipedia.org/wiki/NTFS_symbolic_link) for details.
We use it like this, but we do this as part of our environment setup, and not part of our build script.
mklink /project1/bin/project1.dll /project2/bin/project1.dll
This ensures for us that project2's reference to project1 is always up-to-date, whenever project1 is build, without needing to copy the file. In our case, project2 and project1 are not part of the same solution, and they have no direct references to one another (we do a lot of plugin-type reflection/assembly loading).
Hope this helps.