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

5

15

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.

Lechery answered 1/2, 2021 at 1:28 Comment(0)
F
28

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.

Fluoridation answered 11/3, 2021 at 16:58 Comment(0)
G
10

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

Glyndaglynias answered 12/3, 2021 at 1:34 Comment(2)
It should be Emgu.CV.Bitmap not Engu.CV.BitmapMusetta
Sorry , but it won't works for me , I'm getting always the same error 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.Wisner
F
5

I encountered the same error. I don't know why we're getting it, but I was able to find a workaround.

  1. Visit the nuget page for the package.
  2. Click "Download Package" to download the nuget package directly.
  3. Open the downloaded file using your archive utility of choice and navigate to the "\runtimes\win-x64\native" folder.
  4. Copy both dll files into the output directory of your project.

After doing this, my code executed without error. Make sure to install emgu.CV.Bitmap as well.

Fraase answered 6/2, 2021 at 1:43 Comment(2)
Thank you for the tip. In my case I had to take the files in the "\runtimes\win-x86\native" folder.Honna
took me time to understand section 3. "archive utility" = 7z [no, winrar doesn't]. Thx! helped meSaire
C
1

I changed my projects Target Framework to ".NET Framework 4.6" and then went to "Manage NuGet Packages", selected "Browse", typed in "emgu.cv.runtime" then installed version 4.5.1.4349 and it worked.

Chon answered 22/6, 2021 at 20:41 Comment(0)
E
0

Here is how I solved it,
1- downgrade .Net framework to 4.6 from project properties
2- Uninstall Emgu.CV and related ones (you will see which ones needed to be uninstalled in Errors List)
3- Install Emgu.CV.runtime.windows from Solution Nuget Manager ( it should install fine now) 3- upgrade .Net framework to 4.8
4- install Emgu.CV 4.5.1 (latest)
5- install Emgu.CV.UI 4.5.1 (Emgu.CV.Bitmwp was installed automatically for me)
and that's it, now you can use bitmap.ToImage<Bgr,Byte>(), note that the Image<Bgr,byte>(bitmap) doesn't work anymore.

Etom answered 8/3, 2021 at 21:49 Comment(1)
4.5.1.x is the latest you can install this way. 4.5.2 and up are not working this way unfortunatelly as I see.Deboradeborah

© 2022 - 2025 — McMap. All rights reserved.