MC9000
MC9000

Reputation: 2433

Can't registering a custom .net8 dll in Windows10 - Could not load file or assembly 'system.runtime, Version=8.0.0.0 ... .Net8 installed

I wrote a custom dll targeting Windows10 & up, yet, no matter the method I use to register it (via the command line or via PowerShell), I get the same error message:

From Regasm.exe:

C:\TestPrograms\ShellExtension>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\regasm /codebase /tlb shellextension.dll 
Microsoft .NET Framework Assembly Registration Utility version 4.8.9037.0
for Microsoft .NET Framework version 4.8.9037.0
Copyright (C) Microsoft Corporation.  All rights reserved.

RegAsm : error RA0000 : Could not load file or assembly 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

From PowerShell (via a script):

PS C:\TestPrograms\ShellExtension> .\Register-ShellExtension.ps1 -assemblyPath "C:\TestPrograms\ShellExtension\ShellExtension.dll"
C:\TestPrograms\ShellExtension\Register-ShellExtension.ps1 : Could not load file or assembly 'System.Runtime,
Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find
the file specified.

Basically it doesn't seem to be able to find the .Net8 framework, yet all versions are installed as can be seen by this test:

PS C:\TestPrograms\ShellExtension> dotnet --list-runtimes
Microsoft.AspNetCore.App 8.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 8.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Also to note, this is a clean Win10 22H2 x64 Test machine - nothing fancy on it, just a base config with .Net 8 installed.

I compiled the dll (Windows class library) for .Net 8 - and I have gotten other console apps to run that are also compiled for .Net 8 and they run just fine.

I could be wrong, but was under the impression that it was possible to run Windows shell extensions starting with .Net5 .

Upvotes: 0

Views: 241

Answers (0)

Related Questions