Skip to content

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

Closed
@HolyOne

Description

@HolyOne

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions