Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure Pipeline build with GitVersion and .NET Core3 Preview fails #1706

Closed
thoemmi opened this issue Jun 11, 2019 · 4 comments
Closed

Azure Pipeline build with GitVersion and .NET Core3 Preview fails #1706

thoemmi opened this issue Jun 11, 2019 · 4 comments

Comments

@thoemmi
Copy link
Contributor

thoemmi commented Jun 11, 2019

For the next version of my OSS project TinyLittleMvvm I switched to Azure Pipeline and use .NET Core 3 Preview (it's a WPF library). I'm using the most recent version 5.0.0-beta3-33 of GitVersion.
The Azure Pipeline is configured in azure-pipelines.yml.

Unfortunately, the build of ths library fails on the hosted build agent:

Exception in initialization: System.ArgumentNullException: Value cannot be null.
Parameter name: SDKPackageID 
   at UtilPack.ArgumentValidator.ValidateNotEmpty(String parameterName, String value)
   at NuGetUtils.MSBuild.Exec.EnvironmentValue..ctor(EnvironmentInspectionResult result)
   at NuGetUtils.MSBuild.Exec.NuGetExecutionCache.<>c__DisplayClass6_1.<<DetectEnvironmentAsync>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at NuGetUtils.MSBuild.Exec.NuGetExecutionCache.DetectEnvironmentAsync(EnvironmentKeyInfo keyInfo, IBuildEngine be, CancellationToken token)
   at NuGetUtils.MSBuild.Exec.NuGetExecutionTaskFactory.InitializeAsync(InitializationArgs args)
   at NuGetUtils.MSBuild.Exec.NuGetExecutionTaskFactory.Initialize(String taskName, IDictionary`2 parameterGroup, String taskBody, IBuildEngine taskFactoryLoggingHost)
C:\Users\VssAdministrator\.nuget\packages\gitversiontask\5.0.0-beta3-33\build\functionality\GitVersionMultiTargetBuild.targets(6,5): error MSB4175: The task factory "NuGetUtils.MSBuild.Exec.NuGetExecutionTaskFactory" could not be loaded from the assembly "C:\Users\VssAdministrator\.nuget\packages\nugetutils.msbuild.exec\2.0.5\build\\netcoreapp2.1\NuGetUtils.MSBuild.Exec.dll". The task factory must return a value for the "TaskType" property. 

You can see the full build log here: https://dev.azure.com/thoemmi/TinyLittleMvvm/_build/results?buildId=63&view=logs&j=12f1170f-54f2-53f3-20dd-22fc7dff55f9&t=006e6f7c-8314-5e02-a3df-483f3a1f4cfa&l=48

It may be related to #1697, but in my case there's no deadlock.

@adamshergold
Copy link

Very similar issue for me with an ASP.NET Core 3 Preview 6 and 5.0.0-beta3-34 of GitVersionTask. Docker image is mcr.microsoft.com/dotnet/core/sdk:3.0.100-preview6 and I get the error below:

012264/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(158,5): message NETSDK1057: You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview [/builds/adamshergold/example.aspnet.fs/src/server/server.fsproj]
MSBUILD : Task factory error NMSBT001: Exception in initialization: System.ArgumentNullException: Value cannot be null. [/builds/adamshergold/example.aspnet.fs/src/server/server.fsproj]
MSBUILD : Task factory error NMSBT001: Parameter name: SDKPackageID [/builds/adamshergold/example.aspnet.fs/src/server/server.fsproj]
MSBUILD : Task factory error NMSBT001:    at UtilPack.ArgumentValidator.ValidateNotNull[T](String parameterName, T value) [/builds/adamshergold/example.aspnet.fs/src/server/server.fsproj]
MSBUILD : Task factory error NMSBT001:    at UtilPack.ArgumentValidator.ValidateNotEmpty(String parameterName, String value) [/builds/adamshergold/example.aspnet.fs/src/server/server.fsproj]
MSBUILD : Task factory error NMSBT001:    at NuGetUtils.MSBuild.Exec.EnvironmentValue.NotEmptyIfNoErrors(Boolean hasErrors, String paramName, String paramValue) [/builds/adamshergold/example.aspnet.fs/src/server/server.fsproj]
MSBUILD : Task factory error NMSBT001:    at NuGetUtils.MSBuild.Exec.EnvironmentValue..ctor(EnvironmentInspectionResult result) [/builds/adamshergold/example.aspnet.fs/src/server/server.fsproj]
MSBUILD : Task factory error NMSBT001:    at NuGetUtils.MSBuild.Exec.NuGetExecutionCache.<>c__DisplayClass6_1.<<DetectEnvironmentAsync>b__1>d.MoveNext() [/builds/adamshergold/example.aspnet.fs/src/server/server.fsproj]
MSBUILD : Task factory error NMSBT001: --- End of stack trace from previous location where exception was thrown --- [/builds/adamshergold/example.aspnet.fs/src/server/server.fsproj]
MSBUILD : Task factory error NMSBT001:    at NuGetUtils.MSBuild.Exec.NuGetExecutionCache.DetectEnvironmentAsync(EnvironmentKeyInfo keyInfo, IBuildEngine be, CancellationToken token) [/builds/adamshergold/example.aspnet.fs/src/server/server.fsproj]
MSBUILD : Task factory error NMSBT001:    at NuGetUtils.MSBuild.Exec.NuGetExecutionTaskFactory.InitializeAsync(InitializationArgs args) [/builds/adamshergold/example.aspnet.fs/src/server/server.fsproj]
MSBUILD : Task factory error NMSBT001:    at NuGetUtils.MSBuild.Exec.NuGetExecutionTaskFactory.Initialize(String taskName, IDictionary`2 parameterGroup, String taskBody, IBuildEngine taskFactoryLoggingHost) [/builds/adamshergold/example.aspnet.fs/src/server/server.fsproj]
/root/.nuget/packages/gitversiontask/5.0.0-beta3-34/build/functionality/GitVersionBuild.targets(6,5): error MSB4175: The task factory "NuGetUtils.MSBuild.Exec.NuGetExecutionTaskFactory" could not be loaded from the assembly "/root/.nuget/packages/nugetutils.msbuild.exec/2.0.5/build/netcoreapp2.1/NuGetUtils.MSBuild.Exec.dll". The task factory must return a value for the "TaskType" property. [/builds/adamshergold/example.aspnet.fs/src/server/server.fsproj]

@arturcic
Copy link
Member

@thoemmi @adamshergold, do you mind giving a try to this version. Just curious if it works with .net core preview. After releasing GitVersion 5.0.0, I'll have a look on targeting the .net core 3.0 as well, but just curious if it works with the current version of GitVersion

@thoemmi
Copy link
Contributor Author

thoemmi commented Jul 1, 2019

It works, thanks a lot
(unfortunately, I first replied to the wrong issue)

@thoemmi thoemmi closed this as completed Jul 1, 2019
@adamshergold
Copy link

@arturcic - yes, works for me too many thanks (apologies it took me a few days to check)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants