Reputation: 195
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 here
bitmap.ToImage<Bgr, byte>(); function.
Why am I getting this error? Any help would be greatly appreciated.
Upvotes: 15
Views: 18587
Reputation: 101
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:
These Emgu packages should now appear under your references and you should not see a package.config file.
Upvotes: 10
Reputation: 21
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.
Upvotes: 1
Reputation: 370
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.
Upvotes: 28
Reputation: 1398
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.
Upvotes: 0
Reputation: 341
I encountered the same error. I don't know why we're getting it, but I was able to find a workaround.
After doing this, my code executed without error. Make sure to install emgu.CV.Bitmap as well.
Upvotes: 6