.Net assembly for db migration can't be registered if com-interop is set under project properties build in vs

Bathory 1 Reputation point
2020-09-14T04:39:57.297+00:00

I want to create a C# .Net dll as Add-In for Enterprise Architect in Visual Studio. This dll has to be registered for com-interop to be used by Enterprise Achitect.

Within this dll I also want to do a database migration with code first and nuget package microsoft.entityframework.core. This database migration works fine with the paket manager console in visual studio if the com-interop checkbox in project properties build is un-checked. If it's checked my dll can't compile. The error message is:

The assembly "... .dll" can not be registered. The method "DisposeAsync" in type "Microsoft.EntityFrameworkCore.DbContext" of assembly "Microsoft.EntityFrameworkCore, Version 3.1.8..." has no implementation.

In my original code I have no functions with any kind of Dispose or similar. It's a simple project with a few lines of code. I tried to manage it in nuget package manager with older versions of Microsoft.EntityFrameworkCore, but it didn't help. Also I had overwritten the DisposeAsync function within my code, but this didn't also help.

The relevant code is within the context class the line with DbContext:

using Microsoft.EntityFrameworkCore;

namespace ...

{

    public class .. : DbContext

    {

In Google I couldn't find anything so please help me.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
38,759 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AmeliaGu-MSFT 13,976 Reputation points Microsoft Vendor
    2020-09-14T09:32:29.847+00:00

    Hi @Bathory ,

    Your issue is more related to .NET.
    .NET is currently not supported in the Q&A forums. I suggest you open a thread in the dedicated .NET forum so that people there will help you more effectively.

    Best Regards,
    Amelia


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

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.