Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emgu error when trying to install emgu.CV.runtime.windows in VC# 2017

Tags:

c#

emgucv

I'm trying to install emgu.CV.runtime.windows from within Visual Studio 2017, and installing by the recommeded method of right-clicking references and installing via NuGet.

However I am getting the error below.

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.7.2, 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.

According to the package information, its dependencies are enter code here.NetStandardVersion=2.0 enter code here.Engu.CV (> 4.5.1 && < 4.5.2) enter code here.Engu.runtime.windows.msvc.rt.x86 (= 19.28.29336) enter code here.Engu.runtime.windows.msvc.rt.x64 (= 19.28.29336)

I checked and c:\windows\Microsoft.NET\Framework contains a folder for v2.0.50727, so it seem .net 2.0 is installed (as is v3.0, v3.5, v4.0.30319)

I have emgu.CV 4.5.1.4349 installed.

I need this library so that I can have the enter code herebitmap.ToImage<Bgr, byte>(); function.

Why am I getting this error? Any help would be greatly appreciated.

like image 374
Scott Mooney Avatar asked Feb 01 '21 01:02

Scott Mooney


People also ask

What is EMGU?

Emgu CV is a cross platform . Net wrapper to the OpenCV image processing library. Allowing OpenCV functions to be called from . NET compatible languages. The wrapper can be compiled by Visual Studio and Unity, it can run on Windows, Linux, Mac OS, iOS and Android.


Video Answer


2 Answers

The solution is migrating from package.config to package references for every project you have. Simply right click on package.config and click "migrate package.config to PackageReference".

Then, install the runtime package again and it will work.

like image 199
Josef Bauer Avatar answered Oct 20 '22 18:10

Josef Bauer


For the new Emgu Nuget package you do need to use PackageReference instead of the traditional package.config.

What worked for me on Visual Studio 2017:

  1. Uninstall all NuGet Packages [This removes the package.config file]
  2. Go to Tools --> Options --> NuGet Package Manager --> General
  3. Change the default package management format to "PackageReference"
  4. Check "allow format selection on first package install"
  5. Click OK
  6. Install Emgu.CV, Emgu.CV.Bitmap, Emgu.CV.UI and Emgu.CV.runtime.windows

These Emgu packages should now appear under your references and you should not see a package.config file.

Nuget Options Image

like image 9
PSU26 Avatar answered Oct 20 '22 16:10

PSU26