System.Management unavailable when targeting net46
See original GitHub issueI have a multi-targeting project with <TargetFrameworks>netstandard1.3;net46</TargetFrameworks>
set.
I have some code which does a WMI query. I’d like to conditionally compile it for NET46
, and do something else for NETSTANDARD1_3
, but apparently I can’t use System.Management.ManagementObjectSearcher
, System.Management.ManagementObject
and friends in either framework.
Am I missing something?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Not able to use System.Management.dll in Dot Net Core
Guess you have to define machine you are interacting with and then try to invoke native calls for such information (PInvokes for win...
Read more >Microsoft .NET Framework Repair Tool is available
Repair operation can be optionally scoped to target a set of specified product baselines. If this option is not specified, the tool will...
Read more >Error MSB4018 when building ReactReduxSpa ...
After upgrading to current Visual Studio 2017RC build I keep getting build errors (MSB4018, FileNotFoundException, System.IO.
Read more >Multi-targetting .Net Framework and .Net Core in a single project
A 15-second guide and 15-minute walk through. You have a .Net Core project, whether a netstandard library, or a netcore app, and you'd...
Read more >NuGet — Targeting both .NET Standard and the .NET ...
NET Core versions of all of our libraries I decided to take a look at the story around creating packages which could target...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@yaakov-h Do you also have a referennce to System.Management? A basic project would look something like this:
@dsplaisted a-ha, that’s what I was missing. I wasn’t sure how to add a reference like that, the IDE provides nothing for that.
That works, thanks.