Description
I am creating a build in TFS where I have a command line task Publish which runs the following:
Tool: dotnet
Arguments: publish Foo.Api.cproj -c "Release" -f "net461" -r "x86" -o "PublishOuputFolder"
cproj is a dotnet core project, referencing 4.6.1 Framework.
It references a legacy Resource library which references 4.6.1 as well.
Everything is migrated to VS2017.
dotnet --version -> 1.0.1
If I try to publish the proj by using the above task in TFS build or just run it manually from the command prompt, I am getting the following error:
2017-05-17T14:06:51.5798345Z Executing the following command-line. (workingFolder = D:\tfsAgent_work\af1728783\CI_NAME_API\drop\NAME\API\Foo.Api)
2017-05-17T14:06:51.5808111Z dotnet publish Foo.Api.csproj -c Release -f "net461" -r "x86" -o "PublishOutputFolder"
2017-05-17T14:06:51.5812994Z Error message highlight pattern:
2017-05-17T14:06:51.5822760Z Warning message highlight pattern:
2017-05-17T14:06:52.0354184Z Microsoft (R) Build Engine version 15.1.548.43366
2017-05-17T14:06:52.0363950Z Copyright (C) Microsoft Corporation. All rights reserved.
2017-05-17T14:06:59.2886266Z Microsoft (R) Xml Schemas/DataTypes support utility
2017-05-17T14:06:59.2891149Z [Microsoft (R) .NET Framework, Version 4.0.30319.1]
2017-05-17T14:06:59.2896032Z Copyright (C) Microsoft Corporation. All rights reserved.
.....................
2017-05-17T14:07:01.9454669Z C:\Program Files (x86)\dotnet\sdk\1.0.1\Microsoft.Common.CurrentVersion.targets(4072,5): error MSB3030: Could not copy the file "obj\Release\en\Foo.ResourceLibrary.resources.dll" because it was not found. [D:\tfsAgent_work\af1728783\CI_NAME_API\drop\NAME\Foo.ResourceLibrary\Foo.ResourceLibrary.csproj]
When I check the project folder, I see that all the *.resource files exist in subfolder ...\Foo.ResourceResourceLibrary\obj\Release\ but no dll files
If I build/publish the project in VS 2017 with the same configuration settings, than it creates folder:
...\Foo.ResourceResourceLibrary\obj*x86*\Release\
where all the dll resource files are created properly, then moved to bin folder and publishing is successful.
But if I use dotnet publish (command line or task in tfs build), it doesn't create the dll files in the intermediate output (obj) folder and the Publish task fails.
Any ideas?