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.
Related
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.
I recently installed TFS 2017 Express on my Windows 10 Pro PC. I also have Visual Studio 2017 Pro installed on the same machine. When trying to build a solution on TFS, I noticed a persistent behavior. If my solution includes a unit test project, the build process fails at the "Visual Studio Build" step. If I remove the unit test project, commit to TFS, and queue a new build, the build succeeds.
I made sure to indicate "Visual Studio 2017" in the Nuget and Visual Studio build steps and "latest" in the Test build step.
These are the relevant excerpts from the log:
(Warning) Visual Studio version '15.0' not found. Looking for the latest version.
(Error) HelloConsole\packages\Microsoft.Net.Compilers.2.1.0\build\Microsoft.Net.Compilers.props (13, 5)
HelloConsole\packages\Microsoft.Net.Compilers.2.1.0\build\Microsoft.Net.Compilers.props(13,5): Error : Microsoft.Net.Compilers is only supported on MSBuild v14.0 and above
(Error) Process 'msbuild.exe' exited with code '1'.
I would include any other logs or screenshots if that would help diagnose the issue.
This symptom only happens when a C# unit test project is present. Are there any workarounds so that I can run TFS builds with a C# unit test project in the solution?
I did look at the available documentation and see nothing helpful in this scenario. I drilled through that document and looked into MSBuild Command-Line Reference, thinking I could direct Visual Studio Build to use MSBuild version 15. All I found under "version" was /version: Display version information only. The project isn’t built.
Update:
I see that there are two different ways to download TFS Express. The way I downloaded it had no mention of version. I downloaded it from here and scrolled to "Team Foundation Server Express" and clicked "Download". There was no mention of a version, as indicated by #PatrickLu-MSFT.
According to the error message logged above:
Microsoft.Net.Compilers is only supported on MSBuild v14.0 and above
TFS build are using the msbuild version distributed with .NET Framework, which is an old version. You could manually check if there are the path to the version distributed with VS 2017 / Build Tools for VS 2017 on the build agent which should be like
xxx\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe
Then directly use this MSBuild.exe run the solution with unit test project on the build agent. This will narrow down if the issue related to build agent environment or not.
Suggest you to enable verbose debug mode to get more detail log for troubleshooting.
You could also upgrade your TFS Express to latest version Team Foundation Server Express 2017 Update 3, and for the build task such as Visual Studio Build, make sure you have selected the latest task version(on left corner of the configuration page).
I just created CordovaApp (Multi-Device Hybrid App) in VS 2013. The application was working fine. Then I tried to open app with VS 2015 Community edition in another machine (and on same machine) and I am receiving following error:
Severity Code Description Project File Line Suppression State
Error The specified directory to the Visual Studio extension
D:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO
14.0\COMMON7\IDE\EXTENSIONS\APACHECORDOVATOOLS\node.exe either does not exist, or does not contain a packages\vs-mda sub-directory. Please
check that the extension directory exists and set the MDAVsixDir
variable to the correct
directory. MyAppCordovaApp C:\Users\foouser\AppData\Roaming\npm\node_modules\vs-mda-targets\Microsoft.MDA.targets 105
I also installed Cordova Tools for VS update 6.
Is there any known work-around for this issue?
I am facing the same issue. Cordova project created in VS2013 is not going to run/debug at VS2015.
NodeJS module used for building the project is no longer called vs-mda (i.e. Visual Studio Multi-Device Application) but vs-tac (i.e. Visual Studio Tools for Apache Cordova).
After perform manual migration, it is working now.
See reference:-
http://mariusbancila.ro/blog/2015/07/31/migrating-a-cordova-project-from-visual-studio-2013-to-visual-studio-2015/
MSBuild is now provided with Visual Studio and its versioning is aligned with Visual Studio. It is also provided as a standalone installer (Microsoft Build Tools 2013) as seen here: http://www.visualstudio.com/en-us/downloads
Due to a bugfix that Microsoft put out in Visual Studio 2013 Update 3, I am trying to find the equivalent build of MSBuild to install on the build server. The version of MSBuild referenced in the download link above is 12.0.21005.1, which equates to the initial version of VS2013.
I can't find anywhere with a version of the Microsoft Build Tools 2013 installer that has been built after Update 3 was released. The VS2013 Update 3 build number is 12.0.30723.0.
Does anyone know where to find this? Or is there an alternative method of copying an updated version of MSBuild from my dev machine (which has VS2013 Update 3) to the build server?
I do not want to install Visual Studio in full on the build server.
Extra Information
The reason I need VS2013 update 3 build tasks is because the SignFile task was updated to take a targetframeworkversion parameter which gets around a bug with signing ClickOnce apps. See http://msdn.microsoft.com/en-us/library/ms164304.aspx.
Here is one later version:
https://chocolatey.org/packages/microsoft-build-tools/12.0.21005.20140416
Microsoft Build Tools 2013 12.0.21005.20140416
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.