You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 14, 2024. It is now read-only.
Missing assembly reference for .NETFramework,Version=v4.7.2 [Microsoft.Management.Infrastructure.Runtime.Win] #48
Trying to install the package Microsoft.Management.Infrastructure.Runtime.Win with NuGet for VisualStudio, I run into this error:
Severity Code Description Project File Line Suppression State
Error Could not install package 'Microsoft.Management.Infrastructure.Runtime.Win 2.0.0'. 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.
Context:
I was trying to publish an application but I ran into
Strong name signature not valid for this assembly Microsoft.Management.Infrastructure.dll.
So I tried to reinstall Microsoft.Management.Infrastructure but Microsoft.Management.Infrastructure.Runtime.Win is a dependency.
I'm seeing this issue on all new c# projects with .Net Framework (tested on 4.5.1, 4.6.2 and 4.8) however I can get the package to work on .Net 6.0. What's weirder is that I already have a separate project (4.6.2 based) which has been happily using this package for years.
If you only care about Windows, Windows already ships Microsoft.Management.Infrastructure.dll so you should ref the one in Windows whereas this one is for non-Windows
I think thats where a lot of people (myself included) are getting the impression that this is the correct package to use when trying to do things correctly 😄
Activity
dave-q commentedon Nov 11, 2021
Is there any info on this?
The documentation recommends using this over system.management but it appears we can't for 4.7.2 applications? Some guidance would be appreciated
ld0614 commentedon Jul 11, 2022
I'm seeing this issue on all new c# projects with .Net Framework (tested on 4.5.1, 4.6.2 and 4.8) however I can get the package to work on .Net 6.0. What's weirder is that I already have a separate project (4.6.2 based) which has been happily using this package for years.
SteveL-MSFT commentedon Jul 11, 2022
If you only care about Windows, Windows already ships Microsoft.Management.Infrastructure.dll so you should ref the one in Windows whereas this one is for non-Windows
ld0614 commentedon Jul 11, 2022
Thanks for the update Steve, the Microsoft WMI documentation directly links to the docs for this Repo and explicitly advises that we use this one over the built in library https://docs.microsoft.com/en-us/windows/win32/wmisdk/using-wmi#obtaining-data-from-wmi
I think thats where a lot of people (myself included) are getting the impression that this is the correct package to use when trying to do things correctly 😄
KWodarczyk commentedon Apr 18, 2024
Can someone look into this and provide workaround ? it's been 4 years :(