0

I have a project that builds properly, but fails in Teamcity. Since Teamcity relies on MSBuild, I ran msbuild manually to see the problem.

So, I take the .net 4.7 / asp.net / core .net 2.0 project and clone it into 2 folders:

On one, I do a build and publish with VS: no errors

On the other folder, I do:

msbuild Test.sln /p:Configuration=Release /p:Platform="Any CPU" /t:publish

and I get 2 errors (twice the same for different libs)

C:\Program Files\dotnet\sdk\2.0.0\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Publish.targets(249, 5): error MSB4018: The "ResolvePublishAssemblies" task failed unexpectedly.
System.ArgumentNullException: Value cannot be null.
Parameter name: path1
   at System.IO.Path.Combine(String path1, String path2)
   at Microsoft.NET.Build.Tasks.PublishAssembliesResolver.<GetResolvedFiles>d__7.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at Microsoft.NET.Build.Tasks.PublishAssembliesResolver.Resolve(ProjectContext projectContext)
   at Microsoft.NET.Build.Tasks.ResolvePublishAssemblies.ExecuteCore()
   at Microsoft.NET.Build.Tasks.TaskBase.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()

I can't really find good info since everything about this error is about beta versions of .net 2.0

Any idea?

5
  • it would help to get a diagnostic or binary log from the build. could you add /bl to the command and upload the resulting msbuild.binlog file? You could even open an issue at github.com/dotnet/sdk about it since this is where the failing task comes from. Aug 25, 2017 at 20:47
  • I just did the same post on on their github (github.com/dotnet/sdk/issues/1542) I will post any answers here.
    – Thomas
    Aug 26, 2017 at 11:59
  • Are you using the latest version of .NET 2.0 (not beta)? Aug 27, 2017 at 11:51
  • Can try this command? msbuild Test.sln /p:DeployOnBuild=true /p:PublishProfile=<profile-name> /p:Configuration=Release /p:Platform="Any CPU" Aug 27, 2017 at 11:52
  • yes, I'm using the final version of .NET 2.0
    – Thomas
    Aug 27, 2017 at 11:53

1 Answer 1

0

This was resolved through information from:

dotnet restore vs. nuget restore with teamcity

I had another project with different errors, but similar problems and the information posted there allowed to solve both.

1
  • thanks for sharing your solution here, you could mark it as the answer, so it could help other community members who get the same issues.
    – Leo Liu
    Aug 30, 2017 at 5:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.