Reputation: 1789
I would like to publish .NET Core 2 with Visual Studio 2017 15.4 – I have created console app and do only Console.Write and Read for test purpose. Next I would like to publish this for windows so I have changed project properties to:
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
When I’m trying to do publish with default stings I have and error “Publish failed” and output have this error “Could not copy the file "obj\x64\Release\netcoreapp2.0\win10-x64\ConsoleApp6.dll" because it was not found.” Another thing is that I can find exe in “bin\x64\Release\netcoreapp2.0\win10-x64” but after run there is no text I have written in my app but I can see “host-options:” and couple of options?
I don't know why error occurs and why I see “host-options:” after run the app?
Upvotes: 1
Views: 1733
Reputation: 147
It seems to be a bug when using custom folders for different platforms with publishing. I have the same issue.
The error indicates that it searches the ConsoleApp6.dll
in the path obj\x64\Release\netcoreapp2.0\win10-x64
.
But in my case, the .dll file was in obj\x64\Release\netcoreapp2.0\
.
My workaround was to copy the .dll file manually to obj\x64\Release\netcoreapp2.0\win10-x64
(and other platform folders) and then publish the app again.
This also resolves the "host-options:" problem you mentioned when running the app. This simply appears because it could not publish / build it successfully for the given platform.
Upvotes: 1