Skip to content

System.Management does not work with .net core 3.0 prev 7 #12860

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

Closed
HolyOne opened this issue Aug 4, 2019 · 2 comments
Closed

System.Management does not work with .net core 3.0 prev 7 #12860

HolyOne opened this issue Aug 4, 2019 · 2 comments

Comments

@HolyOne
Copy link

HolyOne commented Aug 4, 2019

I have an existing class using System.Management code which works.

I created a .net core 3 web app (I run on visual studio with Administrator permisions)
I get marshal error when I try to connect WMI at the first line.

This is the line I call
DNS = new ManagementScope (@"\\localhost\root\MicrosoftDNS") ;

This is the error I get
System.Runtime.InteropServices.MarshalDirectiveException: 'Cannot marshal 'parameter #3': Cannot marshal a string by-value with the [Out] attribute.'

I do not use any win32 dll call or out parameter in my code so I thought it must be an internal error on System.Management or .net core 3 preview

image

Thank you

@HolyOne
Copy link
Author

HolyOne commented Aug 5, 2019

I just tried latest prerelease ( 4.6.0-preview7.19362.9) and it seems it passes this line

@Pilchie
Copy link
Member

Pilchie commented Aug 6, 2019

This issue was moved to dotnet/corefx#40048

@dotnet dotnet locked and limited conversation to collaborators Aug 6, 2019
@Pilchie Pilchie closed this as completed Aug 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants