Build Errors with .NET Core
Hi, I'm struggling setting up a build configuration for an ASP.NET Core application. It is built on top of .NET 4.6.2.
Using TC 2017.2.3 (build 51047)
First, I just selected 2 of the steps with the Auto-detect feature suggested for me. They were both .NET CLI (dotnet) steps, the first being a restore, the second being a build.
I experienced the following 2 errors:
C:\TeamCity\buildAgent\work\e750507e31e2921a\RACS.MALT.Offline.API.Web\RACS.MALT.Offline.API.Web\RACS.MALT.Offline.API.Web.csproj error MSB4236: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found.
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(1126, 5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6.2" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
Since then, I installed .NET Framework 4.6.2 (Offline installer), as I figured that was the problem. Now, when I click the Run button, a yellow panel pops out with the message: Warning: No enabled compatible agents for this build configuration. Please register a build agent or tweak build configuration requirements.
I'm not quite sure what the next step is. I thought by using a couple of the suggested build steps, this smoke test would be a "lay-up".
How should I proceed to resolve this?
Thanks
Please sign in to leave a comment.
Hi David,
please make sure you restarted the agent's process after installing the .net framework. Also, make sure that the SDK is installed, not just the runtime, as compiling will require access to the SDK.
With this in mind, the error message you see now means that no build agent has the requirements to run the builds. This usually means that the build agent is not running or has not detected the required libraries in your system to run this build. If they are installed, restarting should help. If they aren't, you will need to install them as mentioned.
Hi Denis,
OK, I've progressed a bit. But this is the build error now
C:\TeamCity\buildAgent\work\e750507e31e2921a\RACS.MALT.Offline.API.Web\RACS.MALT.Offline.API.Mvc\RACS.MALT.Offline.API.Mvc.csproj(429,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets.
Note: the previous build step was a restore step.
I've made no progress on this. I can't find any documentation to assist or blog posts on the Internet.
The bare information out there just says to install the .NET Core SDK and that is installed already.
The version of the .NET CLI is version 2.1.300
Why is it struggling with restoring netstandard? If I manually Publish, I am able to deploy this.
You said something I thought was unusual in your first post. .NET Core provides alternative frameworks to the old .NET frameworks.You said you are using framework 4.6.2 when a .NET core app would be using netstandard2.0.
This may be totally unrelated to your problem, but it seems off to me.