Receiving an error while try to register DLL with RegAsm.exe: "Could not load file or assembly 'System.Runtime, Version=8.0.0.0, Culture=neutral ,..."

2024-02-07T09:22:32.6766667+00:00

I try to register DLL with RegAsm.exe but I receive this error:

RegAsm : warning RA0000 : Registering an unsigned assembly with /codebase can cause your assembly to interfere with other applications that may be installed on the same computer. The /codebase switch is intended to be used only with signed assemblies. Please give your assembly a strong name and re-register it.> RegAsm : error RA0000 : Could not load file or assembly 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=...' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058) Lately I upgraded my project to latest .net8. I installed ASP.NET Core Runtime 8.0.1 and .NET Desktop Runtime 8.0.1.

I need to register this DLL in order to use it locally for another product that requires it. what can I do?

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
12,065 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,195 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,749 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RLWA32 47,206 Reputation points
    2024-02-07T09:53:53.0633333+00:00

    Lately I upgraded my project to latest .net8. I installed ASP.NET Core Runtime 8.0.1 and .NET Desktop Runtime 8.0.1.

    Regasm.exe is used to register a COM Server hosted in a .Net Framework class library. A properly written COM server hosted in .Net class library should be registered with regsvr32.exe


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.