0

I am trying to install EMGU using Nuget. I am using Framework 4.8. WinForms. I'm able to install Emgu.CV but when I try installing Emgu.CV.runtime.windows I get an error saying:

"Could not install package 'Emgu.runtime.windows.msvc.rt.x64 19.28.29336'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.8', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

One solution on stackoverflow (Emgu error when trying to install emgu.CV.runtime.windows in VC# 2017) says that "the solution is migrating from package.config to package references" but it didn't work in my case. When I changed migrating I get an error when installing Emgu.CV too. The error is "Unable to find fallback package folder 'C:\Microsoft\Xamarin\NuGet'."

After these I tried manually installing Emgu.runtime and copying dll files but I got a problem related to cvextern.dll. It says that the file is not accessible. I tried registering it rgsvr32 it didn't work. So working manually didn't help either.

How am I supposed to install EMGU.

  • Uninstall everything related to Emgu.cv. Set the Platform Target to `AnyCPU`. Rebuild the solution. Close Visual Studio. Delete everything in `[Project]\obj`. Install [OpenCV 4.5.2 for Windows](https://opencv.org/releases/). Open up NuGet Package Manager, find `Emgu.cv 4.5.1` and `Emgu.cv.runtime.windows 4.5.1` and install both packages using `PackageReference` as the management format. Check Visual Studio's config, make sure that the default `Package Management` is set to `PackageReference` and `Allow format selection on first package install` is ticked. – Jimi Jul 01 '21 at 10:56
  • See whether both `Emgu.CV.Platform.NetFramework.dll` and `Emgu.CV.Platform.NetStandard.dll` are added to the output folders (`Debug`/`Release`) of your Solution. All other assemblies are stored in the `x86` and `x64` folders. -- Now, if something goes wrong for some weird reason, build a new Solution and start over. – Jimi Jul 01 '21 at 10:57
  • Thank you.I still get an error when I select PackageReference and try installing Emgu.CV. I get this error: Unable to find fallback package folder 'C:\Microsoft\Xamarin\NuGet\'. – Faik Eren ALTUN Jul 01 '21 at 17:55
  • There's a new version of Emgu.CV, v. 4.5.2, which is based on OpenCV 4.5.2 (that you need to download and install beforehand). Note that Emgu.CV uses .Net Standard, there's just a simple wrapper for .Net Framework. -- Install Emgu.CV 4.5.2 first, then Emgu.CV.runtime.windows 4.5.2. Also add the Emgu.CV.UI package (last). After the installation, you must see the Packages **blue icons** in the Project's References and the standard icon of `Emgu.CV.Platform.NetFramework`. -- Do this in a new Solution. Target **AnyCPU** and remove the default `Prefer 32-bit` check. – Jimi Jul 04 '21 at 00:13
  • The new versions don't install the x86 / x64 components in the Projects output folders (Debug/Release) anymore. -- See that you have updated your Visual Studio installation and .Net Standard is functional. – Jimi Jul 04 '21 at 00:24

1 Answers1

0

.netFramework version is not compatible with the package that you are trying to install.

1-Uninstall the packages completely from your project. 2-downgrade your project's .netFramework version from Properties of the project 3-Reinstall the packages.

  • Yes, it's compatible. Also, `Emgu.runtime.windows.msvc.rt.x64` has no dependencies. The problem is somewhere else (probably some components missing). I know because I use .Net Framework 4.8 with Emgu.CV. – Jimi Jul 04 '21 at 00:21