We are migrating a project from .Net framework 4.8.1 to .Net Core 8.0, we came across following error

Satwadhir 0 Reputation points
2024-08-02T13:53:53.8733333+00:00

Dear Team,

Error Description:

Severity Code Description Project File Line Suppression State Details

Error (active) MC1000 Unknown build error, 'Could not find assembly 'System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Either explicitly load this assembly using a method such as LoadFromAssemblyPath() or use a MetadataAssemblyResolver that returns a valid assembly.'

We are migrating a project from .net framework 4.8.1 to .net Core 8.0, we came across above error. Apparently in .net Core 8.0 System.EnterpriseServices assemlbly is not available, so what would be the correct way to fix the error?

We tried by installing nuget package "System.ServiceModel.Primitive" but error still remains.

Thanks in Advance!

Developer technologies .NET Other
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 60,161 Reputation points
    2024-08-02T16:03:41.6666667+00:00

    Assemblies are not 1:1 between NET Core and NET Framework. You need to identify what specific type(s) you are dependent on in System.EnterpriseServices. Then go to the docs and find the type. Ensure the version is set to NET 8.0 and it'll show you what package you need to include. Note that not all types are supported in NET Core so there may be cases where you have to use alternatives instead.

    The error itself indicates that you are still referencing the original System.EnterpriseServices assembly so remove that from your project's dependencies. If you don't directly reference it then something you are referencing does and you'll need to fix that dependency as well.

    2 people found this answer helpful.

  2. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2024-08-02T15:51:54.69+00:00

    The enterprise services library is based on com+ (dynamic com and remoting). This core feature was not added to the .net core runtimes. Thus the enterprise library was never ported to core, and there is no plan.

    you don’t specify what enterprise features you are using, but you will need a replacement library for each feature.

    1 person found this answer helpful.

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.