Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 4.5.1 not work (from nuget) #399

Closed
nombrote opened this issue Jan 21, 2021 · 18 comments
Closed

Update to 4.5.1 not work (from nuget) #399

nombrote opened this issue Jan 21, 2021 · 18 comments

Comments

@nombrote
Copy link

nombrote commented Jan 21, 2021

I'm trying to update to the new version with nuget.

Its posible to use it on .Net Framework (4.8)? I have a lot of projects (about 60) in the solution and i have problems when try to migrate it.

Severity Code Description Project File Line Suppression State
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.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.

@jenb892
Copy link

jenb892 commented Jan 21, 2021

I have this problem too when trying to install Emgu.CV.runtime.windows in VS 2019 using NuGet. I am getting the same error message as above. Hope that a solution can be found.
I did install .NETStandard version 2.0 in an attempt to solve the problem, but it didn't work.

@emgucv
Copy link
Owner

emgucv commented Jan 21, 2021

Just tried the following steps:

  1. Create a new Windows Form .Net Framework project, targeting .NetFramework 4.8
  2. Add Emgu.CV.runtime.windows v4.5.1.4349 from nuget.org
  3. nuget package manager resolved dependency, installing all packages including Emgu.runtime.windows.msvc.rt.x64
  4. Compile "AnyCPU" and run project.

Works fine without the above error message. I am using Visual Studio 2019 - v16.8.4

Can you provide detail steps to reproduce your issue? Btw, what is the compilation platform? "AnyCPU", "x64" or "x86"?

@nombrote
Copy link
Author

nombrote commented Jan 22, 2021

I have the framework 4.8
The platform configurated is x64, but i was try with anyCpu too.
I'm using Visual Studio 2017 Enterprise (v15.9.26)

I was create a new project (Framework 4.8).
Added reference to Emgu.CV.runtime.windows v4.5.1.4349 from nuget.org
Some 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.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"

I THINK IT'S NOT COMPILATED FOR FRAMEWORK 4.8 ONLY FOR .NET STANDARD.

On nuget, in the package Emgu.CV.runtime.windows, the dependecies say: .Net Standard 2, but dont come there Net Framework. I dont know if its only a message or a requeriment, but dont read there .Net Framework 4.6 or 4.8 like anothers packages like System.Drawing.Common

@nombrote
Copy link
Author

I was download and install Visual Studio 2019 Community (16.8.4) now.
Create a project (Windows Forms, Framework 4.8)
Try to install the package (Emgu.CV.runtime.windows v4.5.1.4349).

Some error: '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

@Wjat777
Copy link

Wjat777 commented Jan 22, 2021

Same issue here:
Visual Studio Version 16.8.4

I created a new WinForms Project, FrameWork=4.8. Any CPU.

At Install by Nuget I get this message:
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.

@nombrote
Copy link
Author

nombrote commented Jan 25, 2021

Please, rebuild the project (Emgu.runtime.windows.msvc.rt.x64) with .Net Framework compatibility and upload to Nuget.

@emgucv
Copy link
Owner

emgucv commented Jan 25, 2021

The target dependency of .NetStandard 2.0 is not an issue here. You can check the Emgu.CV.runtime.windows v4.4.0 nuget package release and can see that it only contains a single binary that targets .NetStandard 2.0.

.NetStandard 2.0 is compatible with .NetFramework 4.8

The Emgu.runtime.windows.msvc.rt.x64 packages contains the native runtime for MSVRT and has no other platform dependencies. This is the MSVC redistributable provided by visual studio. There is not specific platform target because they are native binary that are neither based on ".Net", ".Net Framework" nor ".NetStandard".

I tried again today to use Visual Studio 16.8.4 to create a new WindowsForms package targeting framework 4.8, "AnyCpu", I also cleared all my nuget cache to make sure I am downloading from nuget.org and not any local cache. Selected Emgu.CV.runtime.windows.4.5.1.4349. All packages sucessfully installed, compiles and run without issue. See the nuget package manager below:

Restoring packages for C:\Users\huang\Desktop\tmp\WindowsFormsApp3\WindowsFormsApp3.csproj... GET https://api.nuget.org/v3-flatcontainer/emgu.cv.runtime.windows/index.json OK https://api.nuget.org/v3-flatcontainer/emgu.cv.runtime.windows/index.json 128ms GET https://api.nuget.org/v3-flatcontainer/emgu.cv.runtime.windows/4.5.1.4349/emgu.cv.runtime.windows.4.5.1.4349.nupkg OK https://api.nuget.org/v3-flatcontainer/emgu.cv.runtime.windows/4.5.1.4349/emgu.cv.runtime.windows.4.5.1.4349.nupkg 30ms GET https://api.nuget.org/v3-flatcontainer/emgu.cv/index.json GET https://api.nuget.org/v3-flatcontainer/emgu.runtime.windows.msvc.rt.x86/index.json GET https://api.nuget.org/v3-flatcontainer/emgu.runtime.windows.msvc.rt.x64/index.json OK https://api.nuget.org/v3-flatcontainer/emgu.cv/index.json 122ms GET https://api.nuget.org/v3-flatcontainer/emgu.cv/4.5.1.4349/emgu.cv.4.5.1.4349.nupkg OK https://api.nuget.org/v3-flatcontainer/emgu.cv/4.5.1.4349/emgu.cv.4.5.1.4349.nupkg 33ms OK https://api.nuget.org/v3-flatcontainer/emgu.runtime.windows.msvc.rt.x86/index.json 218ms GET https://api.nuget.org/v3-flatcontainer/emgu.runtime.windows.msvc.rt.x86/19.28.29336/emgu.runtime.windows.msvc.rt.x86.19.28.29336.nupkg OK https://api.nuget.org/v3-flatcontainer/emgu.runtime.windows.msvc.rt.x64/index.json 273ms GET https://api.nuget.org/v3-flatcontainer/emgu.runtime.windows.msvc.rt.x64/19.28.29336/emgu.runtime.windows.msvc.rt.x64.19.28.29336.nupkg OK https://api.nuget.org/v3-flatcontainer/emgu.runtime.windows.msvc.rt.x64/19.28.29336/emgu.runtime.windows.msvc.rt.x64.19.28.29336.nupkg 37ms OK https://api.nuget.org/v3-flatcontainer/emgu.runtime.windows.msvc.rt.x86/19.28.29336/emgu.runtime.windows.msvc.rt.x86.19.28.29336.nupkg 638ms GET https://api.nuget.org/v3-flatcontainer/system.drawing.primitives/index.json GET https://api.nuget.org/v3-flatcontainer/system.runtime/index.json GET https://api.nuget.org/v3-flatcontainer/system.runtime.interopservices.runtimeinformation/index.json OK https://api.nuget.org/v3-flatcontainer/system.drawing.primitives/index.json 118ms GET https://api.nuget.org/v3-flatcontainer/system.drawing.primitives/4.3.0/system.drawing.primitives.4.3.0.nupkg OK https://api.nuget.org/v3-flatcontainer/system.runtime.interopservices.runtimeinformation/index.json 142ms GET https://api.nuget.org/v3-flatcontainer/system.runtime.interopservices.runtimeinformation/4.3.0/system.runtime.interopservices.runtimeinformation.4.3.0.nupkg OK https://api.nuget.org/v3-flatcontainer/system.drawing.primitives/4.3.0/system.drawing.primitives.4.3.0.nupkg 30ms OK https://api.nuget.org/v3-flatcontainer/system.runtime.interopservices.runtimeinformation/4.3.0/system.runtime.interopservices.runtimeinformation.4.3.0.nupkg 56ms OK https://api.nuget.org/v3-flatcontainer/system.runtime/index.json 342ms GET https://api.nuget.org/v3-flatcontainer/system.runtime/4.3.1/system.runtime.4.3.1.nupkg OK https://api.nuget.org/v3-flatcontainer/system.runtime/4.3.1/system.runtime.4.3.1.nupkg 29ms Installing System.Runtime 4.3.1. Installing System.Runtime.InteropServices.RuntimeInformation 4.3.0. Installing System.Drawing.Primitives 4.3.0. Installing Emgu.CV 4.5.1.4349. Installing Emgu.runtime.windows.msvc.rt.x86 19.28.29336. Installing Emgu.runtime.windows.msvc.rt.x64 19.28.29336. Installing Emgu.CV.runtime.windows 4.5.1.4349. NU1602: Emgu.CV.runtime.windows 4.5.1.4349 does not provide an inclusive lower bound for dependency Emgu.CV (> 4.5.1 && < 4.5.2). An approximate best match of Emgu.CV 4.5.1.4349 was resolved. Committing restore... Writing assets file to disk. Path: C:\Users\huang\Desktop\tmp\WindowsFormsApp3\obj\project.assets.json Successfully installed 'Emgu.CV 4.5.1.4349' to WindowsFormsApp3 Successfully installed 'Emgu.CV.runtime.windows 4.5.1.4349' to WindowsFormsApp3 Successfully installed 'Emgu.runtime.windows.msvc.rt.x64 19.28.29336' to WindowsFormsApp3 Successfully installed 'Emgu.runtime.windows.msvc.rt.x86 19.28.29336' to WindowsFormsApp3 Successfully installed 'System.Drawing.Primitives 4.3.0' to WindowsFormsApp3 Successfully installed 'System.Runtime 4.3.1' to WindowsFormsApp3 Successfully installed 'System.Runtime.InteropServices.RuntimeInformation 4.3.0' to WindowsFormsApp3 Executing nuget actions took 370 ms Time Elapsed: 00:00:45.0202009 ========== Finished ==========

Screenshot here:
image

Also tried to install Emgu.CV.runtime.windows 4.4.0 and then upgrade to 4.5.1.4349 without issues.

My nuget package manger version is 4.8.1

@jenb892
Copy link

jenb892 commented Jan 25, 2021

Mine is working now. Maybe it was clearing the cache that helped, although I think that I tried this previously.

@Wjat777
Copy link

Wjat777 commented Jan 25, 2021

Hi,

I clear the Nuget Cache as you recommended and I try update the package. Here my log:
Attempting to gather dependency information for package 'Emgu.CV.runtime.windows.4.5.1.4349' with respect to project 'OpenCV', targeting '.NETFramework,Version=v4.8' Gathering dependency information took 1,68 sec Attempting to resolve dependencies for package 'Emgu.CV.runtime.windows.4.5.1.4349' with DependencyBehavior 'Lowest' Resolving dependency information took 0 ms Resolving actions to install package 'Emgu.CV.runtime.windows.4.5.1.4349' Resolved actions to install package 'Emgu.CV.runtime.windows.4.5.1.4349' GET https://api.nuget.org/v3-flatcontainer/emgu.runtime.windows.msvc.rt.x64/19.28.29336/emgu.runtime.windows.msvc.rt.x64.19.28.29336.nupkg GET https://api.nuget.org/v3-flatcontainer/emgu.runtime.windows.msvc.rt.x86/19.28.29336/emgu.runtime.windows.msvc.rt.x86.19.28.29336.nupkg GET https://api.nuget.org/v3-flatcontainer/emgu.cv.runtime.windows/4.5.1.4349/emgu.cv.runtime.windows.4.5.1.4349.nupkg OK https://api.nuget.org/v3-flatcontainer/emgu.runtime.windows.msvc.rt.x86/19.28.29336/emgu.runtime.windows.msvc.rt.x86.19.28.29336.nupkg 141ms Installing Emgu.runtime.windows.msvc.rt.x86 19.28.29336. OK https://api.nuget.org/v3-flatcontainer/emgu.runtime.windows.msvc.rt.x64/19.28.29336/emgu.runtime.windows.msvc.rt.x64.19.28.29336.nupkg 151ms Installing Emgu.runtime.windows.msvc.rt.x64 19.28.29336. OK https://api.nuget.org/v3-flatcontainer/emgu.cv.runtime.windows/4.5.1.4349/emgu.cv.runtime.windows.4.5.1.4349.nupkg 268ms Installing Emgu.CV.runtime.windows 4.5.1.4349. Install failed. Rolling back... Package 'Emgu.runtime.windows.msvc.rt.x64.19.28.29336' does not exist in project 'OpenCV' Package 'Emgu.runtime.windows.msvc.rt.x64.19.28.29336' does not exist in folder 'C:\Users\wjatj\source\repos\OpenCV\packages' Executing nuget actions took 777 ms 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. Time Elapsed: 00:00:03.2763483 ========== Finished ==========

@emgucv
Copy link
Owner

emgucv commented Jan 25, 2021

@Wjat777 Interesting, I noticed that your Nuget Package manager also do NOT resolve the dependency to include the "Emgu.CV" package (see my log above). I wonder why...
The "Emgu.CV" nuget pacakge is listed as a dependency for Emgu.CV.runtime.windows v4.5.1.4349. What make it tried to add Emgu.runtime.windows.msvc.rt.x64 package but not Emgu.CV package?

What is your nuget package manager version?

Can you zip up your solution and upload it here?

@Wjat777
Copy link

Wjat777 commented Jan 25, 2021

Hi,

What is your nuget package manager version?

Microsoft Visual Studio Community 2019
Version 16.8.4
VisualStudio.16.Release/16.8.4+30907.101
Microsoft .NET Framework
Version 4.8.03752

Installed Version: Community
NuGet Package Manager 5.8.1

It's here
OpenCV.zip

@nombrote
Copy link
Author

I was clean nuget packages, but i have the some error like ever...

Attempting to gather dependency information for package 'Emgu.CV.runtime.windows.4.5.1.4349' with respect to project 'Backend\Sentidos\Vista\Vision.EmguCV', targeting '.NETFramework,Version=v4.8'
Gathering dependency information took 3,36 sec
Attempting to resolve dependencies for package 'Emgu.CV.runtime.windows.4.5.1.4349' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Emgu.CV.runtime.windows.4.5.1.4349'
Resolved actions to install package 'Emgu.CV.runtime.windows.4.5.1.4349'
Removed package 'Emgu.CV.4.4.0.4099' from 'packages.config'
Successfully uninstalled 'Emgu.CV.4.4.0.4099' from Vision.EmguCV
Removed package 'Emgu.CV.Bitmap.4.4.0.4099' from 'packages.config'
Successfully uninstalled 'Emgu.CV.Bitmap.4.4.0.4099' from Vision.EmguCV
Removed package 'Emgu.CV.runtime.windows.4.4.0.4099' from 'packages.config'
Successfully uninstalled 'Emgu.CV.runtime.windows.4.4.0.4099' from Vision.EmguCV
GET https://api.nuget.org/v3-flatcontainer/emgu.runtime.windows.msvc.rt.x86/19.28.29336/emgu.runtime.windows.msvc.rt.x86.19.28.29336.nupkg
GET https://api.nuget.org/v3-flatcontainer/emgu.cv.runtime.windows/4.5.1.4349/emgu.cv.runtime.windows.4.5.1.4349.nupkg
GET https://api.nuget.org/v3-flatcontainer/emgu.runtime.windows.msvc.rt.x64/19.28.29336/emgu.runtime.windows.msvc.rt.x64.19.28.29336.nupkg
GET https://api.nuget.org/v3-flatcontainer/emgu.cv.bitmap/4.5.1.4349/emgu.cv.bitmap.4.5.1.4349.nupkg
GET https://api.nuget.org/v3-flatcontainer/emgu.cv/4.5.1.4349/emgu.cv.4.5.1.4349.nupkg
OK https://api.nuget.org/v3-flatcontainer/emgu.runtime.windows.msvc.rt.x86/19.28.29336/emgu.runtime.windows.msvc.rt.x86.19.28.29336.nupkg 15ms
Installing Emgu.runtime.windows.msvc.rt.x86 19.28.29336.
OK https://api.nuget.org/v3-flatcontainer/emgu.cv.runtime.windows/4.5.1.4349/emgu.cv.runtime.windows.4.5.1.4349.nupkg 22ms
Installing Emgu.CV.runtime.windows 4.5.1.4349.
OK https://api.nuget.org/v3-flatcontainer/emgu.runtime.windows.msvc.rt.x64/19.28.29336/emgu.runtime.windows.msvc.rt.x64.19.28.29336.nupkg 106ms
Installing Emgu.runtime.windows.msvc.rt.x64 19.28.29336.
OK https://api.nuget.org/v3-flatcontainer/emgu.cv/4.5.1.4349/emgu.cv.4.5.1.4349.nupkg 244ms
Installing Emgu.CV 4.5.1.4349.
Error downloading 'Emgu.CV.runtime.windows.4.5.1.4349 : Emgu.CV (4.5.1, 4.5.2), Emgu.runtime.windows.msvc.rt.x64 [19.28.29336, 19.28.29336], Emgu.runtime.windows.msvc.rt.x86 [19.28.29336, 19.28.29336]' from 'https://api.nuget.org/v3-flatcontainer/emgu.cv.runtime.windows/4.5.1.4349/emgu.cv.runtime.windows.4.5.1.4349.nupkg'.
Cannot access a disposed object.

Object name: 'SslStream'.
GET https://api.nuget.org/v3-flatcontainer/emgu.cv.runtime.windows/4.5.1.4349/emgu.cv.runtime.windows.4.5.1.4349.nupkg
Install failed. Rolling back...
Package 'Emgu.runtime.windows.msvc.rt.x64.19.28.29336' does not exist in project 'Vision.EmguCV'
Package 'Emgu.CV.runtime.windows.4.4.0.4099' already exists in folder 'C:\Users\Miguel\Documents\Arduino\src\Robot\packages'
Added package 'Emgu.CV.runtime.windows.4.4.0.4099' to 'packages.config'
Package 'Emgu.CV.Bitmap.4.4.0.4099' already exists in folder 'C:\Users\Miguel\Documents\Arduino\src\Robot\packages'
Added package 'Emgu.CV.Bitmap.4.4.0.4099' to 'packages.config'
Package 'Emgu.CV.4.4.0.4099' already exists in folder 'C:\Users\Miguel\Documents\Arduino\src\Robot\packages'
Added package 'Emgu.CV.4.4.0.4099' to 'packages.config'
Package 'Emgu.runtime.windows.msvc.rt.x64.19.28.29336' does not exist in folder 'C:\Users\Miguel\Documents\Arduino\src\Robot\packages'
Executing nuget actions took 1,75 sec
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.
Time Elapsed: 00:00:05.2094036
========== Finished ==========

@emgucv
Copy link
Owner

emgucv commented Jan 26, 2021

@Wjat777
I have downloaded your zip package, and I can reproduce the issue. Thanks.

Seems like nuget package dependency resolution is broken when using "package.config" to managed nuget package. Microsoft recommend upgrading "package.config" to "package reference":
https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference
All visual studio 2019 project templates also use "package reference" instead of "package.config".

You can perform the migration, by right clicking on "packages.config" follows by a click on the circled option:
image
The project will be upgraded to use "package reference".

Once that is done, the error for installing Emgu.CV.runtime.windows nuget package is gone, I can sucessfully install the nuget package with dependency correctly resolved.

Looks like "package.config" nuget dependency resolution is broken. "Package reference" works.

@emgucv
Copy link
Owner

emgucv commented Jan 26, 2021

@nombrote I noticed you are also using "package.config", please upgrade to "Package reference" using the instructions above. Let me know if that solves your problem. Thanks.

@nombrote
Copy link
Author

nombrote commented Jan 26, 2021

Hi, i upgrade the packages.config to package reference and download it correctly, and after that i can upgrade the references, but give me an error (before all was working):

When declare a mat (m_frame = new Mat();)

Failed to register error handler using RedirectError : en Emgu.CV.CvInvoke.RedirectError(CvErrorCallback errorHandler, IntPtr userdata, IntPtr prevUserdata)
en Emgu.CV.CvInvoke..cctor()
Exception thrown: 'System.TypeInitializationException' in Emgu.CV.Platform.NetStandard.dll
An unhandled exception of type 'System.TypeInitializationException' occurred in Emgu.CV.Platform.NetStandard.dll
Se produjo una excepción en el inicializador de tipo de 'Emgu.CV.MatInvoke'.

@keanhong2
Copy link

@Wjat777
I have downloaded your zip package, and I can reproduce the issue. Thanks.

Seems like nuget package dependency resolution is broken when using "package.config" to managed nuget package. Microsoft recommend upgrading "package.config" to "package reference":
https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference
All visual studio 2019 project templates also use "package reference" instead of "package.config".

You can perform the migration, by right clicking on "packages.config" follows by a click on the circled option:
image
The project will be upgraded to use "package reference".

Once that is done, the error for installing Emgu.CV.runtime.windows nuget package is gone, I can sucessfully install the nuget package with dependency correctly resolved.

Looks like "package.config" nuget dependency resolution is broken. "Package reference" works.

it works ,, haha im so happy after 2 weeks of frustration ,
i trying to build winForm from a scratch , with 4.8 .net Framework

  1. Install EMGU.CV
  2. look for package.config in Project => package.config => right click "Migrate from packages.config to PackageReference"
  3. tick all the item and click ok
  4. now we can download and install Emgu.CV.runtime.windows and Emgu.CV.Bitmap without any errors,.

@emgucv
Copy link
Owner

emgucv commented Jul 8, 2021

Closing ticket now.

@HemantSingla
Copy link

HemantSingla commented Jan 7, 2023

Hi have tried to install 4.4.0.4099 and I am able to install that version from Nuget

Version Above 4.4.0 not able to install through NUGet Package

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants