Why do I get a warning icon when I add a reference to an MEF plugin project?

后端 未结 23 1240
隐瞒了意图╮
隐瞒了意图╮ 2020-11-30 17:30

I wish to test the core class of a plugin by directly referencing the plugin project and instantiating the plugin class. When I create a test Console App project and add a p

相关标签:
23条回答
  • 2020-11-30 18:22

    For me, I ran into this issue when referencing a .NET Standard 2.0 class library in a .NET Framework 4.7.1 console application. Yes, the frameworks are different, but they are compatible (.NET Standard is supposed to jive with both .NET Core and .NET Framework.) I tried cleaning, rebuilding, removing and readding the project reference, etc... with no success. Finally, quitting Visual Studio and reopening resolved the issue.

    0 讨论(0)
  • 2020-11-30 18:23

    For both of (or all of) the projects that you want to use together:

    Right click on the project > Properties > Application > Target .NET framework

    Make sure that both of (or all of) your projects are using the same .NET framework version.

    0 讨论(0)
  • 2020-11-30 18:23

    In Asp.net core sometime it shows alert if you changes the project name space or name. To remove this kind of alerts you just Unload Project and load it again. If issue is still there means you it can not find your Assembly reference.

    0 讨论(0)
  • 2020-11-30 18:23

    Thank you all for the help. Here is a breakdown of how I fixed my problem:

    Right click on your project > Properties

    Under Application change the target Framework. In my case ImageSharp was using .Net 4.6.1. You can find this in your packages.config.

    Go to your project references. You'll notice SixLabors has a yellow triangle. You have to update the NuGet package.

    Right click on References > Manage NuGet Packages.

    Update SixLabors.

    You might have slight code updates (see below) but this fixed my problem.

    Convert ImageSharp.Image to ImageSharp.PixelFormats.Rgba32?

    0 讨论(0)
  • 2020-11-30 18:24

    in VS 2017 Do a Clean then Build

    0 讨论(0)
  • 2020-11-30 18:27
    1. Make sure all versions are same for each projects click each projects and see the version here Project > Properties > Application > Target .NET framework

    2. a. Go to Tools > Nuget Package Manager > Package Manager Console Type Update-Package -Reinstall (if not working proceed to 2.b)

      b. THIS IS CRITICAL BUT THE BIGGEST POSSIBILITY THAT WILL WORK. Remove < Target > Maybe with multiple lines < /Target > usually found at the bottom part of .csproj.

    3. Save, load and build the solution.

    0 讨论(0)
提交回复
热议问题