Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET Core 3.0.0 Preview 7 #3075

Closed
vivmishra opened this issue Jul 23, 2019 · 78 comments
Closed

.NET Core 3.0.0 Preview 7 #3075

vivmishra opened this issue Jul 23, 2019 · 78 comments

Comments

@vivmishra
Copy link
Contributor

Release Notes
Download

Blog posts (live after 10 am PST on 7/23/2019)

.NET Core
ASP.NET Core

Please report any issues you find with 3.0.0 Preview 7, either responding to this issue, creating a new issue or creating a new issue in one of the following repos:

@dotnet dotnet locked as too heated and limited conversation to collaborators Jul 23, 2019
@dotnet dotnet unlocked this conversation Jul 23, 2019
@ghost
Copy link

ghost commented Jul 24, 2019

WPF Application
MainWindowxaml:


<Window x:Class="WpfApp33.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApp33"
        mc:Ignorable="d"
        Title="Single Executable Sample" Height="450" Width="800" WindowStartupLocation="CenterScreen" IsEnabled="False">
    <Grid>

    </Grid>
</Window>

WpfApp33.csproj:

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

  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <UseWPF>true</UseWPF>
    <PublishTrimmed>true</PublishTrimmed>
    <PublishReadyToRun>true</PublishReadyToRun>
    <PublishSingleFile>true</PublishSingleFile>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <Platforms>x64</Platforms>
    <OutputPath>bin\X64\Release\</OutputPath>
    <AssemblyVersion>1.0.1.7144</AssemblyVersion>
    <FileVersion>1.0.1.7144</FileVersion>
    <ApplicationIcon>USPS.ico</ApplicationIcon>
  </PropertyGroup>

  <ItemGroup>
    <Compile Update="Properties\Resources.Designer.cs">
      <DesignTime>True</DesignTime>
      <AutoGen>True</AutoGen>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
  </ItemGroup>

  <ItemGroup>
    <EmbeddedResource Update="Properties\Resources.resx">
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
    </EmbeddedResource>
  </ItemGroup>

</Project>

In VScode open the project folder and then run
dotnet publish -r win-x64 -c release

This creates publish as "WpfApp33.exe" that is 137MB in size and runs. fine but if you add a any control to the blank form then it does not run.

    <Grid>
        <Button x:Name="hello" Width="100" Height="35"></Button>
    </Grid>

Remove the control and it runs fine again. Not much good if you cannot have a useful application that is not blank.

@vivmishra
Copy link
Contributor Author

@vatsan-madhavan @amit-kabra for WPF issue.

@vatsan-madhavan
Copy link
Member

@SFC-Sarge, What version of the SDK are you building against? Can you post a full project (zip) that we can use to repro. @jkoritzinsky, @jeffschwMSFT this looks like a ReadyToRun related problem.

@ghost
Copy link

ghost commented Jul 24, 2019 via email

@ghost
Copy link

ghost commented Jul 24, 2019 via email

@ghost
Copy link

ghost commented Jul 24, 2019 via email

@ghost
Copy link

ghost commented Jul 24, 2019 via email

@ghost
Copy link

ghost commented Jul 24, 2019 via email

@vatsan-madhavan
Copy link
Member

@SFC-Sarge if you had an attachment, it didn't come through via email. Would you mind attaching it in GitHub directly?

I have a suspicion that this is related to dotnet/wpf#634 and some (or most) WPF apps may not be usable as ReadyToRun in Preview7. I'll let @jkoritzinsky or @jeffschwMSFT chime in.

@jeffschwMSFT
Copy link
Member

cc @fadimounir

@ghost
Copy link

ghost commented Jul 24, 2019 via email

@ghost
Copy link

ghost commented Jul 24, 2019

Note: I validated this only happens in WPF, Windows Forms works correctly.
WpfApp33.zip

@fadimounir
Copy link

Hmm... that's odd. I can actually run the app with the button control, with PublishTrimmed, PublishReadyToRun and PublishSingleFile. The app doesn't crash, and I can see the button.
Using Preview 7 bits (3.0.100-preview7-012717).

@SFC-Sarge What version of the SDK were you using?

@ghost
Copy link

ghost commented Jul 24, 2019

With true in project file I get the following Warnings:

Some ReadyToRun compilations emitted warnings, indicating potential missing dependencies. Missing dependencies could potentially cause runtime failures. To show the warnings, set the PublishReadyToRunShowWarnings property to true.
2>WpfApp33 -> D:\Workspaces\Training\WpfApp33\WpfApp33\bin\X64\Release\netcoreapp3.0\win-x64\publish
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Publish: 1 succeeded, 0 failed, 0 skipped ==========

@ghost
Copy link

ghost commented Jul 24, 2019

The version I have install is: dotnet-sdk-3.0.100-preview7-012821-win-x64.exe gotten from the download page for SDK.

@ghost
Copy link

ghost commented Jul 24, 2019

But: when I publish I get: JITPath "C:\Users\danny.mcnaught.nuget\packages\microsoft.netcore.app.runtime.win-x64*3.0.0-preview7-27912-14*

That version must come with 16.3 Preview 1 installed this morning.

@ghost
Copy link

ghost commented Jul 24, 2019

With Project file containing: true and true I get:
warining like:
Could not load type 'System.Transactions.Transaction' from assembly 'System.Private.Xml, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. while resolving 0x1000162 - System.Transactions.Transaction.
and others in attached document.
WPF Publish with Net Core 3.docx

@fadimounir
Copy link

I was able to repro the issue with the Preview 8 bits. This issue is caused by enabling the PublishTrimmed switch, not ReadyToRun. Interestingly, I wasn't able to start the app even without the button with the trimming.

cc @sbomer

@fadimounir
Copy link

Could be related to dotnet/linker#628

@ghost
Copy link

ghost commented Jul 25, 2019

Removing PublishTrimmed>true I was able to launch the exe with and without a button control added to the form. So it depends on what SDK version you have installed.

@vatsan-madhavan
Copy link
Member

vatsan-madhavan commented Jul 25, 2019

@fadimounir, I can't repro it with 3.0.100-preview7-012821.

I'm was able to repro a crash with Preview8 bits (3.0.100-preview8-013417).

HResult: 80131534
0:000> !PrintException /d 000001d68cc215d8
Exception object: 000001d68cc215d8
Exception type:   System.TypeLoadException
Message:          Could not load type 'System.Runtime.InteropServices.Marshal' from assembly 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
InnerException:   <none>
StackTrace (generated):
    SP               IP               Function
    000000680D9732F0 0000000000000000 DirectWriteForwarder!<Module>.___CxxCallUnwindDtor(Void (Void*), Void*)+0x1
    000000680D9733A0 00007FFCAEAF8988 DirectWriteForwarder!<Module>..cctor()+0x58

StackTraceString: <none>
HResult: 80131522

I think this is related to the bad typerefs generated by the C++/CLI compiler into DirectWriteForwarder.dll. I'm not sure whether the linker is playing any role or not during PublishTrimmed

@ghost
Copy link

ghost commented Jul 25, 2019

Note: even though without PublishTrimmed>true the button control is not enabled or clickable.

@ghost
Copy link

ghost commented Jul 25, 2019

Nothing I do enables the button on run. design mode shows it enabled but after the exe launches it is grayed out.

@fadimounir
Copy link

I think this is related to the bad typerefs generated by the C++/CLI compiler into DirectWriteForwarder.dll. I'm not sure whether the linker is playing any role or not during PublishTrimmed

I see these exceptions when PublishTrimmed is enabled. Without it, I'm not seeing any of these exceptions.

Nothing I do enables the button on run. design mode shows it enabled but after the exe launches it is grayed out.

Not sure what the issue is here. I can see that too on my end. @vatsan-madhavan ?

@vatsan-madhavan
Copy link
Member

So far I'm unable to repro the button-is-disabled problem...

uJj4VFcar3

@ghost
Copy link

ghost commented Jul 25, 2019

Grayed out button

Do not have video but here is a picture.

@sbomer
Copy link
Member

sbomer commented Jul 29, 2019

@SFC-Sarge, I wasn't able to reproduce this issue with the project you shared above. However the error you're getting looks like it could be caused by the linker (https://aka.ms/dotnet-illink). You could try publishing without PublishTrimmed, or you could try adding the following to your project:

<ItemGroup>
  <TrimmerRootAssembly Include="Microsoft.Management.Infrastructure" />
</ItemGroup>

If your error only shows up with PublishTrimmed, could you please file a new issue at https://github.com/mono/linker? If you still see problems without PublishTrimmed, I would suggest trying just one of PublishReadyToRun or PublishSingleFile to help isolate the problem. On my machine I'm seeing some errors when using PublishSingleFile, though I may not be publishing your project the same way as you are:

Error:
  An assembly specified in the application dependencies manifest (WindowsFormsApp18.deps.json) was not found:
    package: 'Microsoft.PowerShell.Native', version: '7.0.0-preview.1'
    path: 'runtimes/win-x64/native/pwrshplugin.pdb'ModLoad: 00007ffb`cfff0000 00007ffb`d0070000   C:\WINDOWS\System32\bcryptPrimitives.dll

@vatsan-madhavan
Copy link
Member

Hi! On .Net Core 3.0 Preview 7, VS 16.3 Preview 1.

My only error for my WPF project is below (a similar WinForms project that depends on the same assemblies is building and running fine). I have no explicit dependencies on mscorlib, but possibly an implicit one via a 3rd party dependency. Is this a forwarding issue specific to WPF? If so, how to resolve? Thanks!!

Error MC1000 Unknown build error, 'Could not find assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. Either explicitly load this assembly using a method such as LoadFromAssemblyPath() or use a MetadataAssemblyResolver that returns a valid assembly.' C:\Program Files\dotnet\sdk\3.0.100-preview7-012821\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets\Microsoft.WinFX.targets 243

@dcuccia, I've opened dotnet/wpf#1451 to track this - please follow updates there.

/cc @ryalanms Can you take a look?
/cc @grubioe

@ghost
Copy link

ghost commented Jul 29, 2019

@sbomer @vatsan-madhavan @vivmishra
I am publishing using the files located in the ..WindowsFormsApp18\WindowsFormsApp18\Properties\PublishProfiles\FolderProfile1.pubxml
Using Visual Studio Enterprise 2019 16.3 Preview 1.

<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121. 
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <PublishProtocol>FileSystem</PublishProtocol>
    <Configuration>Release</Configuration>
    <Platform>x64</Platform>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <PublishDir>bin\x64\Release\netcoreapp3.0\win-x64\publish\</PublishDir>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <SelfContained>true</SelfContained>
    <_IsPortable>false</_IsPortable>
  </PropertyGroup>
</Project>

for the released version and for debug version:
..WindowsFormsApp18\WindowsFormsApp18\Properties\PublishProfiles\FolderProfile2.pubxml

<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121. 
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <PublishProtocol>FileSystem</PublishProtocol>
    <Configuration>Debug</Configuration>
    <Platform>x64</Platform>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <PublishDir>bin\x64\Debug\netcoreapp3.0\win-x64\publish\</PublishDir>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <SelfContained>true</SelfContained>
    <_IsPortable>false</_IsPortable>
  </PropertyGroup>
</Project>

The error I see in the log file provided was just using Release and Debug from Visual Studio,not the Published option, just run in debug mode and the application with run returns the error in the log file.
Attached is the update solution with the exception reporting to the log file.
WindowsFormsApp18.zip

Added:

<ItemGroup>
  <TrimmerRootAssembly Include="Microsoft.Management.Infrastructure" />
</ItemGroup>

No change in Release/Debug/Publish results. Release/Debug runs but returns the same Error:

Internal Exception: System.TypeInitializationException: The type initializer for 'System.Management.Automation.PSObject' threw an exception.
 ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Management.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
File name: 'Microsoft.Management.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
   at System.Management.Automation.PSObject..cctor()

Publish version of SingleExe does not launch.

Using only the PublishSingleFile option and not the PublishReadyToRun results:
Same results for Release/Debug:

Internal Exception: System.TypeInitializationException: The type initializer for 'System.Management.Automation.PSObject' threw an exception.
 ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Management.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
File name: 'Microsoft.Management.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
   at System.Management.Automation.PSObject..cctor()

Publish SingleExe Result: SingleExe does not launch.

Removing PublishTrimmed and PublishReadyToRun same error result for Release/Debug.
Publish SingleExe Result: SingleExe does not launch.

@ghost
Copy link

ghost commented Jul 29, 2019

@sbomer @vatsan-madhavan @vivmishra
In Release/Debug mode from Visual Studio 2019 I look at the log file created by the application located at c:\temp
Publish mode just does not run/launch.

@sbomer
Copy link
Member

sbomer commented Jul 29, 2019

@SFC-Sarge, thanks for the additional details. Looks like this is unrelated to PublishTrimmed/PublishReadyToRun/PublishSingleFile. I believe you're hitting the problem described in https://stackoverflow.com/questions/56352672/running-powershell-from-net-core-could-not-load-file-or-assembly-microsoft-ma - try using a non-portable RID as suggested in the first answer on that thread. There are a number of issues open in the PowerShell repo with other folks hitting similar issues with the Microsoft.Management.Infrastructure package, such as PowerShell/PowerShell#8119 (comment).

@ghost
Copy link

ghost commented Jul 29, 2019

@sbomer
Thanks I will look at those.

@ghost
Copy link

ghost commented Jul 29, 2019

@sbomer
Thanks for opening the ticket on the PowerShell site.

@ghost
Copy link

ghost commented Jul 29, 2019

@sbomer
Tried the non-portable RID like it stated but would not publish:
Error reported:

7/29/2019 7:26:08 PM
System.AggregateException: One or more errors occurred. ---> System.Exception: Publishing failed.
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Microsoft.Publish.Framework.Model.DefaultPublishSteps.<>c__DisplayClass26_0.<IsBuildCompletedSuccessfully>b__2()
   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.Publish.Framework.Model.DefaultPublishSteps.<DefaultCorePublishStep>d__23.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.Publish.Framework.ViewModel.ProfileSelectorViewModel.<RunPublishTaskAsync>d__205.MoveNext()
---> (Inner Exception #0) System.Exception: Publishing failed.<---

System.Exception: Publishing failed.

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

Non-PID

Only changed the debug version of FolderProfile2.pubxml

<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121. 
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <PublishProtocol>FileSystem</PublishProtocol>
    <Configuration>Debug</Configuration>
    <Platform>x64</Platform>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <PublishDir>bin\x64\Debug\netcoreapp3.0\win-x64\publish\</PublishDir>
    <RuntimeIdentifier>win7-x64</RuntimeIdentifier>
    <SelfContained>true</SelfContained>
    <_IsPortable>false</_IsPortable>
  </PropertyGroup>
</Project>

@ghost
Copy link

ghost commented Jul 30, 2019

@sbomer @vivmishra @vatsan-madhavan
I looked at the installed version of Microsoft.Management.Infrastructure 1.0.0 on my developer machine the picture shows that has a win10-64 not win-64. Tried renaming to win-64 but did not make a difference. I believe this is why Microsoft.Management.Infrastructure cannot be found. I did try and use win10-64 in my publish xml but still could not find Microsoft.Management.Infrastructure.
I am not sure but should Microsoft use the same naming convention for this? If it is possible to rename I do not know what other files or registry needs to be changed to support the rename.
Microsoft Management Infrastructure
I even added the Microsoft.Management.Infrastructure to the project file:
Microsoft Management Infrastructure 0 0inProj
which give me this list under the nuget in the solution:
Microsoft Management Infrastructure 0 0innuget
Still does not find Microsoft.Management.Infrastructure during publish and still gives the same error in the log file during Release/Debug testing under Visual Studio Enterprise.
logError

@sbomer
Copy link
Member

sbomer commented Jul 30, 2019

@SFC-Sarge here's what I'm seeing. Starting with the last solution you shared,

  • Changing the RID in WindowsFormsApp18.csproj to win7-x64 gets around the problem with Microsoft.Management.Infrastructure during the build (Debug/Release), but hits a similar issue with Microsoft.PowerShell.Commands missing.
  • Adding a package reference to Microsoft.PowerShell.SDK fixes that issue (this is what the powershell hosting sample for .NET Core does: https://github.com/PowerShell/PowerShell/tree/master/docs/host-powershell). However I'm not familiar with their packages, so you may have more luck asking the PowerShell folks about the right way to do this on .NET Core.
  • Changing the RID in WinSetState.csproj and the publish profile to win7-x64 then fixes the publish issue you're seeing and allows publish to finish.

Please give that a try an see if it works for you. I would suggest trying to get this working without PublishSingleFile/PublishReadyToRun/PublishTrimmed first to simplify things. If you run into further issues with the powershell-related packages, I'd suggest filing an issue at https://github.com/PowerShell/PowerShell.

@ghost
Copy link

ghost commented Jul 30, 2019

@sbomer
Thanks I will give it a try tonight. Leaving the office for the day.

@danroth27
Copy link
Member

Yep that is the one I have installed. BTW I learned that after picking the Blazor Server App template and then configuring the Project Name, Location, and Solution, I finally get the option to select Blazor Server App, Blazor (Asp.Net Core hosted), and Blazor (client-side). It wasn't what I expect I expected but it did work for me so far. So I'm all good now.

@judyanndixon Ah, yeah, that's a known bug in this version of VS. The top level Blazor entry in the New Project Dialog is being updated to be generic for both Blazor Server Apps and Blazor WebAssembly Apps in the next preview update. Sorry about the confusion!

@ghost
Copy link

ghost commented Jul 31, 2019

@sbomer
Still not working in Debug mode non-published See new attached sample and log result. New error though so I will also open and issue https://github.com/PowerShell/PowerShell.
WindowsFormsApp18.zip
VSSolutionDebugTest_2019731_080800_pid20116.log

Error does not show and internal exception though:

[2019-07-31 08:08:04Z] <Non-Published Non-SingleExe Debug Test> (E):
Failed to set PowerShell Enabled Execution Policy to Bypass
Exception Message: Cannot load PowerShell snap-in Microsoft.PowerShell.Diagnostics because of the following error: The PowerShell snap-in module D:\Workspaces\Training\WindowsFormsApp18\WindowsFormsApp18\bin\x64\Debug\netcoreapp3.0\win7-x64\Microsoft.PowerShell.Commands.Diagnostics.dll does not have the required PowerShell snap-in strong name Microsoft.PowerShell.Commands.Diagnostics, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, ProcessorArchitecture=MSIL.
Exception StackTrace:    at System.Management.Automation.Runspaces.InitialSessionState.CreateDefault()
   at System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace(PSHost host)
   at System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace()
   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke()
   at WindowsFormsApp18.Form1.EnableExecutionPolicy(String executionPolicy) in D:\Workspaces\Training\WindowsFormsApp18\WindowsFormsApp18\Form1.cs:line 227
   at WindowsFormsApp18.Form1..ctor() in D:\Workspaces\Training\WindowsFormsApp18\WindowsFormsApp18\Form1.cs:line 98
Internal Exception: 

@ghost
Copy link

ghost commented Jul 31, 2019

@sbomer @vivmishra @vatsan-madhavan
Adding the PowerShell.SDK v7.0.0-preview.2 fixed the issue for Release/Debug but not publish.

That fixes Release/Debug Mode from Visual Studio 2019 but publish using either <RuntimeIdentifier>win7-x64</RuntimeIdentifier> or <RuntimeIdentifier>win10-x64</RuntimeIdentifier> in csproj and pub.xml files get this error during publish:
I will return to Net Core Team now for further input.

7/31/2019 9:46:06 AM
System.AggregateException: One or more errors occurred. ---> System.Exception: Publishing failed.
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Microsoft.Publish.Framework.Model.DefaultPublishSteps.<>c__DisplayClass26_0.<IsBuildCompletedSuccessfully>b__2()
   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.Publish.Framework.Model.DefaultPublishSteps.<DefaultCorePublishStep>d__23.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.Publish.Framework.ViewModel.ProfileSelectorViewModel.<RunPublishTaskAsync>d__205.MoveNext()
---> (Inner Exception #0) System.Exception: Publishing failed.<---

System.Exception: Publishing failed.

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

Using <RuntimeIdentifier>win-x64</RuntimeIdentifier> to publish results in the original Microsoft.Management.Infrastructure missing error during linking. But finishes publish successfully but again does not launch.

My question now is if you have different nuget packages install and each require/support a different how does that work? i.e. netcoreapp3.0 likes win-64 but powershell requires win7-64 or win10-64. Can you list all in the section?

@ghost
Copy link

ghost commented Jul 31, 2019

@sbomer @vivmishra @vatsan-madhavan
Here is the update solution that works for Release/debug but not Publish to SingleExe and returns the error in the above comment. The attached log file show that PowerShell now works in Release/debug mode.
VSSolutionDebugTest_2019731_093812_pid47268.log

WindowsFormsApp18.zip

@ghost
Copy link

ghost commented Jul 31, 2019

@sbomer @vivmishra @vatsan-madhavan
That project also launches and works from the D:\Workspaces\Training\WindowsFormsApp18\WindowsFormsApp18\bin\x64\Release\netcoreapp3.0\win10-x64 folder. Since the publish fails not publish folder is created.

@yuanrui

This comment has been minimized.

@ghost
Copy link

ghost commented Aug 1, 2019

@sbomer @vivmishra @vatsan-madhavan
I know someone marked as resolved but I guest the reason is that the singleExe issue is considered the linking issue and will be resolved in Preview 8 for both WPF and WindowsForms, correct?

@ghost
Copy link

ghost commented Aug 1, 2019

@sbomer @vivmishra @vatsan-madhavan
I still have the question for Microsoft: different nuget packages install and each require/support a different <RuntimeIdentifier> how does that work? i.e. another MS nuget package likes win-64 but others MS nuget packages requires win7-64 or win10-64 and does not have win-64. Does that mean you cannot use the two packages together and if so, is there not a naming convention standard for the <RuntimeIdentifier> within Microsoft?

@vatsan-madhavan
Copy link
Member

I still have the question for Microsoft: different nuget packages install and each require/support a different <RuntimeIdentifier> how does that work? i.e. another MS nuget package likes win-64 but others MS nuget packages requires win7-64 or win10-64 and does not have win-64. Does that mean you cannot use the two packages together and if so, is there not a naming convention standard for the <RuntimeIdentifier> within Microsoft?

@richlander, do you want to address this?

@ghost
Copy link

ghost commented Aug 1, 2019

@vivmishra @sbomer @vatsan-madhavan
I now tried the same project with the following settings then tried running the SingleExe and checked the Event Log: The Event Log returned Error, so it still looks like a PowerShell Issue or linker missing a PowerShell File.

WindowsFormsApp18.deps.zip

Note: The non-SingleExe file:

D:\Workspaces\Training\WindowsFormsApp18\WindowsFormsApp18\bin\x64\Release\netcoreapp3.0\win10-x64\WindowsFormsApp18.exe runs fine with out errors.

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Sdk="Microsoft.NET.Sdk.WindowsDesktop">
  <PropertyGroup Label="Globals">
    <OutputType>WinExe</OutputType>
    <RootNamespace>WindowsFormsApp18</RootNamespace>
    <AssemblyName>WindowsFormsApp18</AssemblyName>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <!--<PublishTrimmed>true</PublishTrimmed>-->
    <!--<PublishReadyToRun>true</PublishReadyToRun>
    <PublishReadyToRunShowWarnings>true</PublishReadyToRunShowWarnings>-->
    <PublishSingleFile>true</PublishSingleFile>
    <RuntimeIdentifier>win10-x64</RuntimeIdentifier>
    <UseWindowsForms>true</UseWindowsForms>
    <AssemblyVersion>1.0.22.7151</AssemblyVersion>
    <FileVersion>1.0.22.7151</FileVersion>
    <Platforms>x64</Platforms>
    <NeutralLanguage>en</NeutralLanguage>
    <Authors>Danny McNaught</Authors>
    <Company>Perspecta</Company>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <PlatformTarget>x64</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\x64\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <PlatformTarget>x64</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\x64\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
    <DocumentationFile></DocumentationFile>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.Logging" Version="3.0.0-preview7.19362.4" />
    <PackageReference Include="Microsoft.PowerShell.SDK" Version="7.0.0-preview.2" />
    <PackageReference Include="System.Management" Version="4.6.0-preview7.19362.9" />
    <PackageReference Include="System.Management.Automation" Version="7.0.0-preview.2" />
  </ItemGroup>
  <ItemGroup>
    <TrimmerRootAssembly Include="Microsoft.Management.Infrastructure" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\WinSetState\WinSetState.csproj" />
  </ItemGroup>
  <ItemGroup>
    <Compile Update="Properties\Resources.Designer.cs">
      <DesignTime>True</DesignTime>
      <AutoGen>True</AutoGen>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Update="Properties\Resources.resx">
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
    </EmbeddedResource>
  </ItemGroup>
</Project>

Windows Application Event Log Error:

Description: A .NET Core application failed.
Application: WindowsFormsApp18.exe
Path: D:\Workspaces\Training\WindowsFormsApp18\WindowsFormsApp18\bin\x64\Release\netcoreapp3.0\win10-x64\publish\WindowsFormsApp18.exe
Message: Error:
  An assembly specified in the application dependencies manifest (WindowsFormsApp18.deps.json) was not found:
    package: 'Microsoft.PowerShell.Native', version: '7.0.0-preview.1'
    path: 'runtimes/win-x64/native/pwrshplugin.pdb'

@ghost
Copy link

ghost commented Aug 1, 2019

@vivmishra @sbomer @vatsan-madhavan
Reported this to the PowerShell Team as well.

WindowsFormsApp18.deps.zip

Added the Microsoft.PowerShell.Native nuget package to the project but still get the same Event Log Error:

  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.Logging" Version="3.0.0-preview7.19362.4" />
    <PackageReference Include="Microsoft.PowerShell.Native" Version="7.0.0-preview.1" />
    <PackageReference Include="Microsoft.PowerShell.SDK" Version="7.0.0-preview.2" />
    <PackageReference Include="System.Management" Version="4.6.0-preview7.19362.9" />
    <PackageReference Include="System.Management.Automation" Version="7.0.0-preview.2" />
  </ItemGroup>
Description: A .NET Core application failed.
Application: WindowsFormsApp18.exe
Path: D:\Workspaces\Training\WindowsFormsApp18\WindowsFormsApp18\bin\x64\Release\netcoreapp3.0\win10-x64\publish\WindowsFormsApp18.exe
Message: Error:
  An assembly specified in the application dependencies manifest (WindowsFormsApp18.deps.json) was not found:
    package: 'Microsoft.PowerShell.Native', version: '7.0.0-preview.1'
    path: 'runtimes/win-x64/native/pwrshplugin.pdb'

@ghost
Copy link

ghost commented Aug 5, 2019

Link to PowerShell Issue reported.
PowerShell/PowerShell#10266 (comment)

@ghost
Copy link

ghost commented Aug 21, 2019

Net Core 3 Preview 8 fix the SingleExe issues except for PowerShell still does not work. I add the the current issue with the PowerShell Group at:
PowerShell/PowerShell#10266

@jeffschwMSFT
Copy link
Member

@SFC-Sarge the challenge is that the Microsoft.PowerShell.Native package includes its pdb as part of its dependencies (which is highly unusual). By default we do not package pdbs in the single exe to help reduce the overall size. In this case, if you add 'true' to your project file the project will launch.

@AnukulSharma
Copy link

Whether or not we can have DotNetCore preview and release framework versions alongside each other.
The normal DotNetCore framework behavior is for the preview version to be removed when we install the release version.
Do we have any way to achieve mentioned scenario, If yes Can anyone provide me steps for how to get the 2 versions installed alongside each other.
While installing dotnet-hosting-3.0.0-preview7.19365.7 I am getting below error because I already have 3.0.100 release version.
InstallationError

@richlander
Copy link
Member

Final .NET Core 3.0 release issue: #3430

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests