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 5.0 application installed by ClickOnce may fail to start after being installed #44602

Closed
worldofsites opened this issue Nov 12, 2020 · 15 comments
Labels
area-Host untriaged New issue has not been triaged by the area owner

Comments

@worldofsites
Copy link

Entry in the Windows Application Event Log after app start:

  An assembly specified in the application dependencies manifest (TestApp.deps.json) was not found:
    package: 'System.ServiceModel.Primitives', version: '4.7.0'
    path: 'lib/netcoreapp2.1/System.ServiceModel.dll'

What in TestApp.deps.json:

      "System.ServiceModel.Primitives/4.7.0": {
        "dependencies": {
          "System.Private.ServiceModel": "4.7.0"
        },
        "runtime": {
          "lib/netcoreapp2.1/System.ServiceModel.Primitives.dll": {
            "assemblyVersion": "4.7.0.0",
            "fileVersion": "4.700.19.56502"
          },
          "lib/netcoreapp2.1/System.ServiceModel.dll": {
            "assemblyVersion": "4.0.0.0",
            "fileVersion": "4.700.19.56502"
          }
        }
      },

Related dependencies:

  <ItemGroup>
    <PackageReference Include="Microsoft.PowerShell.Commands.Diagnostics" Version="7.1.0" />
    <PackageReference Include="Microsoft.PowerShell.Commands.Management" Version="7.1.0" />
    <PackageReference Include="Microsoft.PowerShell.Commands.Utility" Version="7.1.0" />
    <PackageReference Include="Microsoft.PowerShell.ConsoleHost" Version="7.1.0" />
    <PackageReference Include="Microsoft.PowerShell.CoreCLR.Eventing" Version="7.1.0" />
    <PackageReference Include="Microsoft.PowerShell.MarkdownRender" Version="7.1.0" />
    <PackageReference Include="Microsoft.PowerShell.Native" Version="7.1.0" />
    <PackageReference Include="Microsoft.PowerShell.SDK" Version="7.1.0" />
    <PackageReference Include="Microsoft.PowerShell.Security" Version="7.1.0" />
    <PackageReference Include="System.Management.Automation" Version="7.1.0" />
  </ItemGroup>
@davidfowl
Copy link
Member

@richlander where do issues like these go?

@AndriiPrystai
Copy link

AndriiPrystai commented Nov 12, 2020

I have similar issue. My app is packed into Windows Installer (WiX toolset). After migration to .NET 5, installer fails to start an app. EventViewer entry:

Description: A .NET application failed.
Application: *******.exe
Path: C:\Program Files\*******\*******\*******.exe
Message: Error:
  An assembly specified in the application dependencies manifest (*******.deps.json) was not found:
    package: 'runtimepack.Microsoft.NETCore.App.Runtime.win-x64', version: '5.0.0'
    path: 'createdump.exe'

[2020-11-13 update] Issue resolved.
Details: WiX toolset project has a custom filter that excludes appsettings* and *.exe files from publish directory except the main app executable.
.NET 5 includes a new tool createdump.exe (Microsoft .NET Runtime Crash Dump Generator) on publish.
After I whitelisted createdump.exe - an app is properly installed and launched.

@Pilchie
Copy link
Member

Pilchie commented Nov 12, 2020

@NikolaMilosavljevic - do you know where this should go?

@NikolaMilosavljevic
Copy link
Member

@NikolaMilosavljevic - do you know where this should go?

It seems that this is not ClickOnce specific - I'd suggest dotnet/runtime to start.

@Pilchie Pilchie transferred this issue from dotnet/aspnetcore Nov 12, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Nov 12, 2020
@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@richlander
Copy link
Member

@worldofsites -- does this only happen when you deploy with ClickOnce?

@worldofsites
Copy link
Author

worldofsites commented Nov 13, 2020

@richlander yes, only when deploy with ClickOnce.
Also, I see these errors not only when I'm using Microsoft.PowerShell libraries.
For example, when I have System.Data.SqlClient dependency I see the following error in Windows Application Event Log:

Message: Error:
  An assembly specified in the application dependencies manifest (Dummy.deps.json) was not found:
    package: 'runtime.win-x64.runtime.native.System.Data.SqlClient.sni', version: '4.4.0'
    path: 'runtimes/win-x64/native/sni.dll'

Microsoft.Data.SqlClient:

Message: Error:
  An assembly specified in the application dependencies manifest (Dummy.deps.json) was not found:
    package: 'Microsoft.Data.SqlClient.SNI.runtime', version: '2.0.1'
    path: 'runtimes/win-x64/native/Microsoft.Data.SqlClient.SNI.dll'

@richlander
Copy link
Member

Is the app published as framework-dependent of self-contained? Also, do you publish in terms of a runtime (like -r win-x64)?

@worldofsites
Copy link
Author

@richlander
We've do some tests:

  1. Framework-dependent (win-x86/win-x64/Portable)
    ClickOnce publish success, install app success, trying to run app - same error:
    path: 'runtimes/win-x86/native/Microsoft.Data.SqlClient.SNI.dll'
    path: 'runtimes/win-x64/native/Microsoft.Data.SqlClient.SNI.dll'
    path: 'runtimes/win/lib/netcoreapp3.1/Microsoft.Data.SqlClient.dll'

  2. Self-Contained (win-x86/win-x64)
    ClickOnce publish success, install app success, trying to run app - same error:
    path: 'runtimes/win-x86/native/Microsoft.Data.SqlClient.SNI.dll'
    path: 'runtimes/win-x64/native/Microsoft.Data.SqlClient.SNI.dll'

  3. Framework-dependent (singlefile + win-x86/singlefile + win-x64)
    Works!

  4. Self-Contained (singlefile + win-x86/singlefile + win-x64)
    Error on publish:

The "GenerateBundle" task failed unexpectedly.
System.ArgumentException: Invalid input specification: Found multiple entries with the same BundleRelativePath
   at Microsoft.NET.HostModel.Bundle.Bundler.GenerateBundle(IReadOnlyList`1 fileSpecs)
   at Microsoft.NET.Build.Tasks.GenerateBundle.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()

@ghost
Copy link

ghost commented Nov 16, 2020

Tagging subscribers to this area: @vitek-karas, @agocke
See info in area-owners.md if you want to be subscribed.

Issue Details
Description:

Entry in the Windows Application Event Log after app start:

  An assembly specified in the application dependencies manifest (TestApp.deps.json) was not found:
    package: 'System.ServiceModel.Primitives', version: '4.7.0'
    path: 'lib/netcoreapp2.1/System.ServiceModel.dll'

What in TestApp.deps.json:

      "System.ServiceModel.Primitives/4.7.0": {
        "dependencies": {
          "System.Private.ServiceModel": "4.7.0"
        },
        "runtime": {
          "lib/netcoreapp2.1/System.ServiceModel.Primitives.dll": {
            "assemblyVersion": "4.7.0.0",
            "fileVersion": "4.700.19.56502"
          },
          "lib/netcoreapp2.1/System.ServiceModel.dll": {
            "assemblyVersion": "4.0.0.0",
            "fileVersion": "4.700.19.56502"
          }
        }
      },

Related dependencies:

  <ItemGroup>
    <PackageReference Include="Microsoft.PowerShell.Commands.Diagnostics" Version="7.1.0" />
    <PackageReference Include="Microsoft.PowerShell.Commands.Management" Version="7.1.0" />
    <PackageReference Include="Microsoft.PowerShell.Commands.Utility" Version="7.1.0" />
    <PackageReference Include="Microsoft.PowerShell.ConsoleHost" Version="7.1.0" />
    <PackageReference Include="Microsoft.PowerShell.CoreCLR.Eventing" Version="7.1.0" />
    <PackageReference Include="Microsoft.PowerShell.MarkdownRender" Version="7.1.0" />
    <PackageReference Include="Microsoft.PowerShell.Native" Version="7.1.0" />
    <PackageReference Include="Microsoft.PowerShell.SDK" Version="7.1.0" />
    <PackageReference Include="Microsoft.PowerShell.Security" Version="7.1.0" />
    <PackageReference Include="System.Management.Automation" Version="7.1.0" />
  </ItemGroup>
Author: worldofsites
Assignees: -
Labels:

area-Host, untriaged

Milestone: -

@John-Hart
Copy link

The missing assembly is being installed by ClickOnce but, it is in the same folder as the application. As was pointed out already, it does not match the relative path that is in the dependencies manifest (*.deps.json).

We have a Visual Studio issue tracking this issue:
https://developercommunity2.visualstudio.com/t/A-NET-Core-31-or-NET-50-application-/1248873

The GenerateBundle build issue when Self-Contained Single File is selected, is being tracked here: https://developercommunity2.visualstudio.com/t/The-GenerateBundle-task-failed-unexpec/1257409

@ctaggart
Copy link
Contributor

I experimented with ClickOnce and .NET 5 this weekend. I can confirm @worldofsites said on Nov 12th, if native dependencies are involved, single file apps that are framework dependent is the only thing that works. I attempted to publish MSBuildStructuredLog as ClickOnce to GitHub pages. It is using Aavalonia libraries which depend on native libraries. I reproduced the issue by create a new project with dotnet new avalonia.app -o AvaloniaApp1, updating the dependencies to latest, removing unused imports, and then trying ClickOnce.

@John-Hart
Copy link

Thanks @ctaggart for taking the time to provide us with this feedback.

We're tracking this issue also as part of this Visual Studio issue: https://developercommunity2.visualstudio.com/t/A-NET-Core-31-or-NET-50-application-/1248873.

@vitek-karas
Copy link
Member

@John-Hart https://developercommunity2.visualstudio.com/t/A-NET-Core-31-or-NET-50-application-/1248873 has been closed. Does it mean we can close this one as well?

@agocke
Copy link
Member

agocke commented Jul 19, 2021

Closing, as this is a ClickOnce issue and the runtime is behaving as designed.

@agocke agocke closed this as completed Jul 19, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Host untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests