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?