I have several MS Test project in my solution, but in build server (TeamCity 7.1), I can't compile them. the exception is saying ...'VisualStudio' namesapce does not exist...
I copied the VisualStudio Tools into the Build server GAC, but still no luck!
The problem is in your test projects. you're referencing to some assemblies which haven't been deployed to the Build Server(TeamCity). Also you cannot do that by simply copy and paste to GAC or working directory.
The best and easiest way to do that is installing Visual studio 2010 Agents in the build server.
It's free and it can be downloaded from MS web site. By installing the agents, it will install all the required libraries for compiling and even running the MSTest projects.
Related
I have updated my Android app target from Android 9 to Android 10 (in accordance with Google Play requirements) recently, and now solution doesn't build on TFS with error:
C:\Program Files\dotnet\sdk\5.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(241,5): Error NETSDK1005: Assets file '...\obj\project.assets.json' doesn't have a target for 'netstandard2.1'. Ensure that restore has run and that you have included 'netstandard2.1' in the TargetFrameworks for your project.
There is the library in the solution that really targets to netstandard2.1, but:
I can build the solution on my desktop with Visual Studio Community 2019 16.4.6.
I can build the solution on TFS server remotely with Visual Studio Community 2019 16.5.1 and 16.8.2.
I cannot build the solution on TFS server via TFS interface. In the build pipeline there is an item Build Xamarin.Android Project which uses MSBuild from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin location (I presume VS should use this MSBuild file too during manual build). The MSBuild file has version 16.8.2.56705.
With the target Android 9 there was no issues with solution building.
What could be a reason? Thank you in advance.
I followed this recommendation to update nuget.exe to the latest version and it helps. But I'm still wondering why simple target's updating without VS update broke a build.
I am trying to replicate my development environment into my build server in order to debug an error that occurs only in the build server, The same solution is compiled with msbuild that is located in C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe in both machines.
In the development machine, the solution is getting compiled successfully while in the build server it fails.
Reading the outputs from msbuild I noticed that in both machines the build is done with different versions of Microsoft build engine
dev machine: 14.0.25420.1
build server:14.0.23107.0
In order to rule out that this error relates to the version
I tried to pass the msbuild from the dev machine to the build server and ran it there which output the build server version.
How can the same msbuild yield different version on a different machine?
How can I update the build engine?
How can the same msbuild yield different version on a different machine?
According to the official blog MSBuild is now part of Visual Studio!:
Starting with Visual Studio 2013, the 2013 version of MSBuild will
ship as a part of Visual Studio instead of the .NET Framework.
So at this moment, MSBuild.exe have the same version of Visual Studio 2015, you can check the version of Visual Studio 2015:
So update the version of Visual Studio on the build server to have the same version MSBuild.exe.
Update for comment:
Is it possible to update msbuild without installing visual studio?
The answer is yes, you can download the Microsoft Build Tools 2015, install it to update msbuild.exe without installing Visual Studio.
Please refer to the document MSBuild is now part of Visual Studio! for details:
The New Microsoft® Build Tools Package
MSBuild is now a component of Visual Studio and will ship with all
SKUs of Visual Studio, including Team Build so if you use Visual
Studio all of your build needs should be covered. We understand that
there are a great number of reasons that you may want to use MSBuild
and other build tools without needing to install Visual Studio so we
are making the tools available as a new standalone package called
Microsoft® Build Tools. The package includes MSBuild and the VB/C#
compilers. The new package can be acquired here on the MSDN Download
Center.
This standalone package is great for build servers requiring fine
grain control of their build process. With this new approach to
evolving MSBuild, you have more control over build behavior and are
not impacted by .NET Framework versions.
Hope this helps.
We currently use TFS 2010 and have numerous build definitions for our various version of our software. We want to use VS2012 for our next version(still using TFS 2010) so is it possible to have both versions of VS on a build controller and will the build process know which version of VS to use or will we need one build controller for VS2010 and one for VS2012? Also I have custom build templates will that present any issues? Then what happens when we upgrade to TFS 2012? will we be able to run automated builds using both VS2010 and VS2012??
In general - yes. Actually Visual Studio doesn't build anything. It's the underlying MSBuild engine that handles the build tasks.
Furthermore, you can setup a build machine without Visual Studio at all, provided that your project don't hold direct references to Visual Studio references paths (e.g. C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies). If there are such references you can copy them to your 3rd party\lib directory in the source control and have the projects refer to that directory as file references.
Other notes:
But Visual Studio will hardly be your biggest hindrance. It's
multi-targeting .NET that will require some extra caffeine :)
The build templates will work as long as you satisfy their custom
references (GAC can used for that matter)
A build controller can be registered with one server at a time
Use a build server for each target framework\VS version
I am doing some maintenance on a set of systems including a SharePoint 2010 site. There is a Visual Studio 2010 solution containing some SharePoint projects that I need to be able to build and deploy.
My developer workstation has a basic setup with Visual Studio 2010 Professional on Windows 7.
Unsurprisingly, all references in this project to the various SharePoint assemblies (Microsoft.SharePoint, Microsoft.SharePoint.Publishing etc.) are all broken and prevent me from building and deploying the project.
The Microsoft developer resources that I've found outline a tortuously involved process of preparing the workstation with various prerequisites, then installing SharePoint while jumping through various hoops - described in some lengthy getting started documents that are, quite frankly, far beyond the scope of the task at hand.
Right now, all I need to do is make some minor corrections, build the project and deploy the updated assemblies and files to the server. I have no need at this point of integrated debugging, template design, site definitions or any of that stuff.
Is there a way to simply install the necessary SharePoint assemblies so that the project will build?
Please?
You can just copy sharepoint dlls from your servers C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\ folder to local machine and register them to the GAC.
Source
Does anyone know the components that need to be installed in order to make the Package Target available via MSBuild.
It's possible to Package using MSBuild on a machine with Visual Studio installed, but not on a build server with only the .NET 4 SDK and Web Deploy 2.0 installed, which results in the following error:
msbuild "Package" does not exist in the project.
It partly comes down to the following missing files on the server:
c:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\*.*
This can of course be resolved by copying the contents of the MSBuild VisualStudio folder to the equivalent directory on the build server, but this is not a manageable solution for server configuration.
All the answers I've read involve having Visual Studio installed or copying the files. Surely it's possible to compile the Web Deploy package without installing Visual Studio?
I have a TeamCity CI server without VS installed building a Web Project configured to also create a deployment package on successful build. However, for the life of me I can't recall if I copied those files manually or if they were installed by some component.
The relevant components I have installed are the following, if you want to give it a shot:
.NET 4.0 SDK;
Microsoft Visual Studio 2010 Shell (Integrated) Redistributable Package;
Visual Studio 2010 SDK; (Not the VS 2010 SDK SP1)
Microsoft Visual Studio 2010 Visualization & Modeling SDK;
Web Deploy 2.0;
I installed the VS Shell in order to be able to install the VS 2010 SDK which in turn was required in order to install the Visualization & Modeling SDK so that I was able to run T4 transformations on the build server.
With this components and configuring the following MSBuild properties DeployOnBuild=true;DeployTarget=Package to create the deploy package I had no problems, but as I said earlier I may have copied the files manually after giving up all hope of finding a more cleaner solution and now my brain is blocking any memory of such ill action.