While running the TeamCity ReSharper inspection command-line tools. There is an error "unknown tools version 17.0" with the following details.
Inspections (ReSharper)
Unknown tools version: 17.0
--- EXCEPTION #1/1 [LoggerException]
Message = "Unknown tools version: 17.0"
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
We noticed this happens after installing VS2022 or VS2022 Build Tools to build agents. Is there a way to fix it?
TeamCity Enterprise 2021.2.2 (build 99660)
Yes, you have to install the R# Command Line Tools (CLT) v2021.3 and enable this tool version in your build configuration.
TeamCity 2021.2.2 does not contain R# CLT 2021.3 by default.
Related
When running dotnet build in my project, I have the following error:
/path/to/repo/Toolkit/My.Company.Toolkit.Platform.Android/My.Company.Toolkit.Platform.Android.csproj(91,3): error MSB4019: The imported project "/usr/local/share/dotnet/sdk/7.0.102/Xamarin/Android/Xamarin.Android.CSharp.targets" was not found. Confirm that the expression in the Import declaration "/usr/local/share/dotnet/sdk/7.0.102//Xamarin/Android/Xamarin.Android.CSharp.targets" is correct, and that the file exists on disk.
/path/to/repo/Toolkit/My.Company.Toolkit.Platform.iOS/My.Company.Toolkit.Platform.iOS.csproj(195,3): error MSB4019: The imported project "/usr/local/share/dotnet/sdk/7.0.102/Xamarin/iOS/Xamarin.iOS.CSharp.targets" was not found. Confirm that the expression in the Import declaration "/usr/local/share/dotnet/sdk/7.0.102//Xamarin/iOS/Xamarin.iOS.CSharp.targets" is correct, and that the file exists on disk.
I confirm that /usr/local/share/dotnet/sdk/7.0.102/Xamarin/iOS/Xamarin.iOS.CSharp.targets does not exist.
But I don't know how to install it there.
The reference to Xamarin is defined in the csproj like this <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />.
When I build from Visual Studio I have no issues. And if I try to re-install Xamarin, it says it is already installed.
I am on MacOS.
[UPDATE]
I uninstalled everything (Visual Studio, SDKs/Runtime, dotnet, etc).
Installed just Visual Studio 2022 for Mac.
➜ ~ dotnet --info
.NET SDK:
Version: 7.0.102
Commit: 4bbdd14480
Runtime Environment:
OS Name: Mac OS X
OS Version: 13.1
OS Platform: Darwin
RID: osx.13-arm64
Base Path: /usr/local/share/dotnet/sdk/7.0.102/
Host:
Version: 7.0.2
Architecture: arm64
Commit: d037e070eb
.NET SDKs installed:
6.0.405 [/usr/local/share/dotnet/sdk]
7.0.102 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.13 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.13 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Now if I try to build the project in the terminal I still have the same error. But if I try to build it from Visual Studio I have a different error.
I have this error in the build output
Target RazorGenerateComponentDeclaration:
/usr/local/share/dotnet/dotnet exec "/Users/redacted/Library/Caches/VisualStudio/17.0/MSBuild/36265_3/Sdks/Microsoft.NET.Sdk.Razor/build/netstandard2.0/../../tools/netcoreapp3.0/rzc.dll" generate
-s
/Users/redacted/Developer/repositories/bcee/Toolkit/MyCompany.Toolkit.Platform.Web/_Imports.razor
-r
_Imports.razor
-o
/Users/redacted/Developer/repositories/bcee/Toolkit/MyCompany.Toolkit.Platform.Web/obj/Debug/netstandard2.1/RazorDeclaration/_Imports.razor.g.cs
-k
component
-p
/Users/redacted/Developer/repositories/bcee/Toolkit/MyCompany.Toolkit.Platform.Web
-t
obj/Debug/netstandard2.1/MyCompany.Toolkit.Platform.Web.RazorComponents.declaration.json
-v
3.0
-c
Default
--root-namespace
MyCompany.Toolkit.Web
--csharp-language-version
8.0
--generate-declaration
The application to execute does not exist: '/Users/redacted/Library/Caches/VisualStudio/17.0/MSBuild/36265_3/Sdks/Microsoft.NET.Sdk.Razor/build/netstandard2.0/../../tools/netcoreapp3.0/rzc.dll'
/Users/redacted/Library/Caches/VisualStudio/17.0/MSBuild/36265_3/Sdks/Microsoft.NET.Sdk.Razor/build/netstandard2.0/Microsoft.NET.Sdk.Razor.Component.targets(106,5): error : rzc generate exited with code 129.
Done building target "RazorGenerateComponentDeclaration" in project "MyCompany.Toolkit.Platform.Web.csproj" -- FAILED.
Done building project "MyCompany.Toolkit.Platform.Web.csproj" -- FAILED.
Build FAILED.
The tools directory does not exists.
At fisrt, you said:
When I build from Visual Studio I have no issues.
The cause should be when you build from the Visual Studio. The framework your project used is .netstandard 2.0. You can check the project.csproj file and the SDK in the /usr/local/share/dotnet/sdk.
In addition, you can check this case which has the similar error as yours. According to it, if the .net version is not compatible with the xamarin will also get this error. dotnet/sdk/7.0.102 should be the .net 7 which is compatible with the .net maui not the xamarin. So you can't use the dotnet build the project.
You can try to find the right value of the MSBuildExtensionsPath and set it in the android and ios .csproj file according to this case which is about set the project's MSBuildExtensionsPath.
Finally, you can try the solution in this case which has the same error message.
The Xamarin tool chain was built upon Mono, so everything you triggered in VS for Mac is kindly processed by MSBuild for Mono (at Mac terminal you can use msbuild --version to learn more).
dotnet build, however, was designed exclusively for .NET Core based projects, so by default it won't be able to handle Xamarin projects, but only .NET MAUI.
As legacy Xamarin projects are going away soon, you should start to migrate to MAUI as soon as you can,
https://dotnet.microsoft.com/en-us/platform/support/policy/xamarin
When attempting to build Boost 1.69.0 from a fresh, clean, checkout, on Windows 10, using Visual Studio 2017, I encounter the following confounding error message:
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.0
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
C:/90cf73ea/tools/boost_install/.\boost-install-dirs.jam:15: in boost-install-dirs.includedir
ERROR: rule "package.paths" unknown in module "boost-install-dirs".
C:/90cf73ea/libs/headers/build/../../../tools/boost_install\boost-install.jam:721: in boost-install.install-cmake-config
libs\headers\build\Jamfile:87: in modules.load
C:/90cf73ea/tools/build/src/build\project.jam:375: in load-jamfile
C:/90cf73ea/tools/build/src/build\project.jam:64: in load
C:/90cf73ea/tools/build/src/build\project.jam:89: in load-used-projects
C:/90cf73ea/tools/build/src/build\project.jam:75: in load
C:/90cf73ea/tools/build/src/build\project.jam:145: in project.find
C:/90cf73ea/tools/build/src\build-system.jam:618: in load
C:\90cf73ea\tools\build\src/kernel\modules.jam:295: in import
C:\90cf73ea\tools\build\src/kernel/bootstrap.jam:139: in boost-build
C:\90cf73ea\boost-build.jam:17: in module scope
I am executing the build commands from the VS2017 command prompt. I am able to execute "bootstrap.bat" without any issues. Running "b2.exe toolset=msvc-14.1" (regardless of any further arguments) results in the above error message. How can I go about diagnosing and/or resolving this error?
FYI, in my case, I had cloned the Boost repo (currently at 1.70.0). Tried to build and got this error. I then did a "git status" and found a bunch of libraries that were untracked (presumably from the 1.70.0 branch). Removing all untracked directories allowed me to build.
Hope that helps someone!
I don't remotely understand why this would be the case, but I solved this issue by updating git from version 2.18.0 to version 2.20.1.
I got this advice on the boost build mailing list:
This error indicates that the the build submodule is not up-to-date.
- Steven Watanbe
I speculate that something in git version 2.18.0 struggled with the boost build submodule. Moral of the story seems to be, check if your git version needs to be updated.
I'm trying to integrate LLVM with Visual Studio 15 2017, however I seem to be unable to get it to work. When running the LLVM installer after Visual Studio has been installed, I get a command prompt with the following error:
Installing MSVC integration...
Failed to find MSBuild toolsets directory.
MSVC integration install failed.
Press any key to continue . . .
After some research online, I found this SO link which has lead me to believe that the LLVM installer does not know how to install for VS15. As such, I tried installing the toolset found here manually. Now, I can see LLVM listed as a toolset in Visual Studio:
However, when I choose it as an option and try to compile a simple "Hello World" program, I get the following error:
error MSB8020: The build tools for LLVM-vs2017 (Platform Toolset = 'LLVM-vs2017') cannot be found.
To build using the LLVM-vs2017 build tools, please install LLVM-vs2017 build tools.
Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution".
Is there something I am doing wrong here, or some step I missed when trying to get these two tools integrated?
LLVM Visual Studio Integration Failed
After the test, you should execute the AutoSetup.bat to install the LLVM 6.0.0 automatically.
Plasmacel provided a fork which is updated for LLVM 6.0.0 and provides better integration by providing include and library paths of LLVM/clang. In the file README.MD, you can find the some more details, like Automatic Installation:
Automatic Installation
Open a command prompt with Administrator rights
(DO NOT OPEN AutoSetup.bat with admin rights it won't load the files)
Go to the folder where AutoSetup.bat exists and type "AutoSetup"
If Automatic doesn't work, you can also go to the Manual Installation.
Hope this helps.
I'm trying to run some unit tests from the command line using Visual Studio 2017 and the vstest.console.exe (C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe), The execution completes successfully on Windows 10 OS but it fails on Windows Server 2016 OS.
Any idea what I could be missing here. I'm guessing it's a simple environment variable that is not being set and I'm unable to nail down the same.
Any help, pointers, support is greatly appreciated from all the experienced VS users out there! Thanks!
The error that I notice is
Error Message:
Failed to set up the execution context to run the test
The machines required the installation of an additional package in VS 2017 for the execution of Unit Tests.
These packages were installed by default with the installation of the .Net Desktop environment earlier but with the latest versions of VS 2017 looks like the auto installation of these packages has been disabled and you need to install them explicitly as additional components.
Packages required for Unit Tests to work:
Under Compilers, build tools, and runtimes
Visual C++ 2017 Redistributable Update
VC++ 2017 version 15.8 v14.15 latest v141 tools
VC++ 2017 version 15.7 v14.14 toolset
After the installation of the above packages Unit Tests can execute successfully!
I seem to be unable to install a build agent on our TeamCity 5.1.2 build server that is compatible with a VS2010 (sln) build configuration.
Under "Build Runners", the following runners are listed:
Ant: Runner for Ant build.xml files
Duplicates finder (.NET): C# and VB duplicate code finder
Command Line: Simple command execution
And under "Compatible configurations", the project I've configured to build with the Visual Studio 2010 (sln) build runner is listed under "Incompatible configurations".
To install the build agent, I'm simply running the .msi installation package, but it seems the default settings are not good enough. The build server machine has Visual Web Developer Express 2010 as well as .NET versions 2.0-4.0 installed, but no full version of VS. Do I need anything more?
(I have no experience whatsoever of building with msbuild scripts, so if I can I want to avoid having to do that.)
I think I figured it out:
Install the Windows SDK from Microsoft. Right now, the latest version is 7.1.
Note that since I just suddenly noticed that it worked, I don't know for certain that this is what did it - it might me completely irrelevant, but this is the only thing in my configuration I changed that I think could be relevant.
TeamCity build agent does not detect .NET 4.0 Client Profile as dotNetFramework4.0. Check you have full .NET Framework 4.0 installed.
Another reason of that is build agent has corrupted plugins. To fix it:
- stop agent
- remove /plugins, /system, /tools folders
- start agent
- wait till agent autoupgrade (agent service may be shown as stopped, just wait)