core icon indicating copy to clipboard operation
core copied to clipboard

.NET Core 2.0 Console App and publish by SCD (win10-x64) will fail

Open vulcanlee opened this issue 9 years ago • 77 comments

Issue Title

I use Visual Studio 2017 (15.4.1) and just create a .NET Core 2.0 Console Project, then publish by RuntimeIdentifiers of win10-x64 and show dialog for "Publish failed" and will get "Could not copy the file "obj\Release\netcoreapp2.0\win10-x64\ConsoleApp3.dll" because it was not found" error message.

Any other RuntimeIdentifiers will also publish failed.

This result will cause me to fail to produce SCD files.

But if I publish above SCD by CLI : dotnet publish -c Release -r win10-x64, it work fine and no problem.

General

My environment is Windows 10 Build 1607 or 1709, and Visual Studio 2017 Enterprise 15.4.1.

The content of .csproj is

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
  </PropertyGroup>

</Project>

Following is my console app sample code

    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }

You can see my all operation on this video.

Following is build output log:

Restoring NuGet packages...
To prevent NuGet from restoring packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages during build.'
1>------ Build started: Project: ConsoleApp3, Configuration: Release Any CPU ------
1>ConsoleApp3 -> C:\Vulcan\GitHub\temp\ConsoleApp3\ConsoleApp3\bin\Release\netcoreapp2.0\ConsoleApp3.dll
2>------ Publish started: Project: ConsoleApp3, Configuration: Release Any CPU ------
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Roslyn\csc.exe /noconfig /unsafe- /checked- /nowarn:1701,1702,1705,1701,1702,2008 /nostdlib+ /platform:x64 /errorreport:prompt /warn:4 /define:TRACE;RELEASE;NETCOREAPP2_0 /errorendlocation /preferreduilang:en-US /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\Microsoft.CSharp.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\Microsoft.VisualBasic.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\Microsoft.Win32.Primitives.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\mscorlib.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\netstandard.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.AppContext.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Buffers.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Collections.Concurrent.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Collections.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Collections.Immutable.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Collections.NonGeneric.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Collections.Specialized.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.ComponentModel.Annotations.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.ComponentModel.Composition.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.ComponentModel.DataAnnotations.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.ComponentModel.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.ComponentModel.EventBasedAsync.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.ComponentModel.Primitives.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.ComponentModel.TypeConverter.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Configuration.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Console.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Core.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Data.Common.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Data.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Diagnostics.Contracts.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Diagnostics.Debug.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Diagnostics.DiagnosticSource.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Diagnostics.FileVersionInfo.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Diagnostics.Process.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Diagnostics.StackTrace.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Diagnostics.TextWriterTraceListener.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Diagnostics.Tools.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Diagnostics.TraceSource.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Diagnostics.Tracing.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Drawing.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Drawing.Primitives.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Dynamic.Runtime.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Globalization.Calendars.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Globalization.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Globalization.Extensions.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.IO.Compression.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.IO.Compression.FileSystem.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.IO.Compression.ZipFile.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.IO.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.IO.FileSystem.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.IO.FileSystem.DriveInfo.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.IO.FileSystem.Primitives.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.IO.FileSystem.Watcher.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.IO.IsolatedStorage.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.IO.MemoryMappedFiles.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.IO.Pipes.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.IO.UnmanagedMemoryStream.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Linq.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Linq.Expressions.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Linq.Parallel.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Linq.Queryable.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Net.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Net.Http.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Net.HttpListener.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Net.Mail.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Net.NameResolution.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Net.NetworkInformation.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Net.Ping.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Net.Primitives.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Net.Requests.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Net.Security.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Net.ServicePoint.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Net.Sockets.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Net.WebClient.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Net.WebHeaderCollection.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Net.WebProxy.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Net.WebSockets.Client.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Net.WebSockets.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Numerics.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Numerics.Vectors.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.ObjectModel.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Reflection.DispatchProxy.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Reflection.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Reflection.Emit.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Reflection.Emit.ILGeneration.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Reflection.Emit.Lightweight.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Reflection.Extensions.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Reflection.Metadata.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Reflection.Primitives.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Reflection.TypeExtensions.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Resources.Reader.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Resources.ResourceManager.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Resources.Writer.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Runtime.CompilerServices.VisualC.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Runtime.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Runtime.Extensions.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Runtime.Handles.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Runtime.InteropServices.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Runtime.InteropServices.RuntimeInformation.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Runtime.InteropServices.WindowsRuntime.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Runtime.Loader.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Runtime.Numerics.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Runtime.Serialization.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Runtime.Serialization.Formatters.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Runtime.Serialization.Json.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Runtime.Serialization.Primitives.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Runtime.Serialization.Xml.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Security.Claims.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Security.Cryptography.Algorithms.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Security.Cryptography.Csp.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Security.Cryptography.Encoding.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Security.Cryptography.Primitives.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Security.Cryptography.X509Certificates.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Security.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Security.Principal.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Security.SecureString.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.ServiceModel.Web.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.ServiceProcess.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Text.Encoding.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Text.Encoding.Extensions.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Text.RegularExpressions.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Threading.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Threading.Overlapped.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Threading.Tasks.Dataflow.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Threading.Tasks.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Threading.Tasks.Extensions.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Threading.Tasks.Parallel.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Threading.Thread.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Threading.ThreadPool.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Threading.Timer.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Transactions.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Transactions.Local.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.ValueTuple.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Web.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Web.HttpUtility.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Windows.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Xml.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Xml.Linq.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Xml.ReaderWriter.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Xml.Serialization.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Xml.XDocument.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Xml.XmlDocument.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Xml.XmlSerializer.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Xml.XPath.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Xml.XPath.XDocument.dll /reference:C:\Users\vulcan\.nuget\packages\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\WindowsBase.dll /debug- /debug:portable /filealign:512 /nologo /optimize+ /out:obj\Release\netcoreapp2.0\win10-x64\ConsoleApp3.dll /ruleset:"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Team Tools\Static Analysis Tools\\Rule Sets\MinimumRecommendedRules.ruleset" /target:exe /warnaserror- /utf8output /deterministic+ Program.cs "C:\Users\vulcan\AppData\Local\Temp\.NETCoreApp,Version=v2.0.AssemblyAttributes.cs" obj\Release\netcoreapp2.0\win10-x64\ConsoleApp3.AssemblyInfo.cs /warnaserror+:NU1605
2>Could not copy the file "obj\Release\netcoreapp2.0\win10-x64\ConsoleApp3.dll" because it was not found.
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========

vulcanlee avatar Oct 20 '17 16:10 vulcanlee

Does this only happen if you set the RuntimeIdentifiers? If you remove that property, does VS build successfully?

It seems like VS is looking for the dll in the wrong output folder: it should look under bin and not obj. Does it work if you run msbuild.exe ConsoleApp3.csproj?

If that fails as well, could you run msbuild.exe ConsoleApp3.csproj /bl:log.binlog and then share the binlog file with us?

livarcocc avatar Oct 20 '17 17:10 livarcocc

@livarcocc

  1. Yes, this only happed if I set the RuntimeIdentifiers and when I remove this property, VS will build successfully.

  2. I run msbuild.exe ConsoleApp3.csproj and it works fine.

vulcanlee avatar Oct 20 '17 17:10 vulcanlee

@Pilchie given that this works in VS and the command line, can you have someone take a look at it from the ProjectSystem point of view. Also noted that I tried on the latest 15.5 bits and I can't repro it.

livarcocc avatar Oct 20 '17 17:10 livarcocc

@livarcocc

I just install VS 2017 Preview and re-create a new project, then publish by RuntimeIdentifiers of win10-x64. This progress also is failed.

But the dialog of publish failed show a log file and I have put as following

2017/10/21 10:41:39 System.AggregateException: One or more errors occurred. ---> System.Exception: Publishing failed. --- End of inner exception stack trace --- at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at Microsoft.VisualStudio.ApplicationCapabilities.Publish.Model.DefaultPublishSteps.<>c__DisplayClass22_0.b__1() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ApplicationCapabilities.Publish.Model.DefaultPublishSteps.d__19.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ApplicationCapabilities.Publish.ViewModel.ProfileSelectorViewModel.d__102.MoveNext() ---> (Inner Exception #0) System.Exception: Publishing failed.<---

===================

vulcanlee avatar Oct 21 '17 14:10 vulcanlee

Can you try win-x64 instead of win10-x64?

Petermarcu avatar Oct 21 '17 15:10 Petermarcu

@Petermarcu

I have changed to win-x64

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
  </PropertyGroup>

</Project>

but it also got following error log on my VS2017 15.5 preview.

2017/10/22 下午 08:02:19
System.AggregateException: One or more errors occurred. ---> System.Exception: Publishing failed.
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.ApplicationCapabilities.Publish.Model.DefaultPublishSteps.<>c__DisplayClass22_0.<IsBuildCompletedSuccessfully>b__1()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ApplicationCapabilities.Publish.Model.DefaultPublishSteps.<DefaultCorePublishStep>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.ApplicationCapabilities.Publish.ViewModel.ProfileSelectorViewModel.<RunPublishTaskAsync>d__102.MoveNext()
---> (Inner Exception #0) System.Exception: Publishing failed.<---

===================

vulcanlee avatar Oct 22 '17 12:10 vulcanlee

And it does still work from the command line with dotnet publish -r win-x64?

Petermarcu avatar Oct 22 '17 16:10 Petermarcu

@Petermarcu

Yes, it work fine and all files for SCD have been generated.

C:\Vulcan\Gitbook\Temp\ConsoleApp1>dotnet publish -r win-x64

  ConsoleApp1 -> C:\Vulcan\Gitbook\Temp\ConsoleApp1\ConsoleApp1\bin\Debug\netcoreapp2.0\win-x64\ConsoleApp1.dll
  ConsoleApp1 -> C:\Vulcan\Gitbook\Temp\ConsoleApp1\ConsoleApp1\bin\Debug\netcoreapp2.0\win-x64\publish\

C:\Vulcan\Gitbook\Temp\ConsoleApp1>

vulcanlee avatar Oct 23 '17 02:10 vulcanlee

@Petermarcu Does VS2017 invoke dotnet.exe CLI internally?

doggy8088 avatar Oct 23 '17 14:10 doggy8088

Just encountered this issue.

NPSF3000 avatar Oct 23 '17 16:10 NPSF3000

@Pilchie @natidea this stack seems to be inside VS itself. Can you guys direct this to the right person?

livarcocc avatar Oct 23 '17 17:10 livarcocc

@BillHiebert is this yours?

Pilchie avatar Oct 23 '17 18:10 Pilchie

@BillHiebert is probably the closest person to be able to describe what VS publish does internally. I'm not sure that it calls out to dotnet.exe.

Petermarcu avatar Oct 24 '17 03:10 Petermarcu

@vijayrkn - can you respond?

BillHiebert avatar Oct 24 '17 17:10 BillHiebert

I think It is failing from VS because the runtimeIdentifier to use during publish is not specified. You are specifying it for the commandline scenario when you pass this flag (-r win-x64) but this is not specified in the VS publish scenario.

Solution: 1.You can either change the RuntimeIdentifiers to RuntimeIdentifier in the csproj and publish from VS should succeed. 2. You can keep the RuntimeIdentifiers in csproj but for the profile that you are publishing, you can specify the RuntimeIdentifier to use. This can be done from the profile settings UI or adding this property(RuntimeIdentifier) to the pubxml under Properties\PublishProfiles\profilename.pubxml

vijayrkn avatar Oct 24 '17 17:10 vijayrkn

@vijayrkn

I have changed RuntimeIdentifiers to RuntimeIdentifier in the csproj and can publish from VS successfully.

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
  </PropertyGroup>

</Project>

If I use multiple RIDs, like this : win-x64;osx-x64;rhel-x64 in the csproj and republish any one of RIDs. The project of Visual Studio will become unavailable.

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <RuntimeIdentifier>win-x64;osx.10.11-x64;rhel-x64</RuntimeIdentifier>
  </PropertyGroup>

</Project>

But in this web page Self-contained deployment without third-party dependencies, the <RuntimeIdentifiers> tag can use multiple RIDs.

My question is that how can I use multiple RIDs in the csproj and can publish from VS?

Multiple RIDs

vulcanlee avatar Oct 25 '17 02:10 vulcanlee

if you want to specify multiple RIDs in the csproj, then you need to set RuntimeIdentifiers instead of RuntimeIdentifier in the csproj (In the above screenshot you are missing the trailing 's' ).

<RuntimeIdentifiers>win-x64;osx.10.11-x64;rhel-x64</RuntimeIdentifiers>

Once this is set, you can restore the project and go to the publish setting page and pick the RID that you need to publish with (and click save). Then you will be able to publish for that specific RID.

vijayrkn avatar Oct 25 '17 02:10 vijayrkn

@vijayrkn

When I set RuntimeIdentifiers in the csproj and specify multiple RIDs, and publish any RID (change from publish setting page) from Visual Studio will be failed.

vulcanlee avatar Oct 25 '17 02:10 vulcanlee

@vulcanlee Thank you for reporting this issue. We can reproduce the issue on our side with the latest released bits. We will investigate the root cause and get back.

/cc @mlorbetske

vijayrkn avatar Oct 25 '17 19:10 vijayrkn

@vijayrkn do you still need this open here? Is the issue understood and is there any more that can be shared?

Petermarcu avatar Nov 01 '17 04:11 Petermarcu