runtime: .NET 5.0 application installed by ClickOnce may fail to start after being installed

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>

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 15 (9 by maintainers)

Most upvoted comments

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

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.

@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()