Share via

instance object NetFwTypeLib creates indirect reference to dotnet 4.0 in visual studio 2017

Anonymous
2017-11-02T13:57:30+00:00

Hi,

I did a Library which use NetFwTypeLib to setup Windows Firewall. It works successfully for month.

I just upgrade the solution included this Library from Visual Studio 2015 to Visual Studio 2017. 

Now, I cannot no more compile without warning and errors. The library raises warning:

At least one of the arguments for 'NETCONLib.INetConnection.GetProperties' cannot be marshaled by the runtime marshaler.  Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate.

and all projects using this Library no more found the library's reference this error:

Impossible to resolve primary reference "...dll", because it had an indirect dependancy on assembly mscorlib , Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 which version is greater than vers ion 2.0.0.0 of the actual Framework

The error only raises on debug mode, into release mode only the warning raises:

thanx for you help

Windows for home | Windows 10 | Settings

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2017-11-03T10:33:26+00:00

    Some news: when i launch the app, a error raises when trying to access the NetFwTypeLib:

    Impossible to load file or assembly ''CustomMarshalers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. File not found.

    All my projects are set to compile in Framework 2.0, i don't understand why it try to load a 4.0 assembly ?!?

    Solution works well when compiling with VS2015 :(

    Was this answer helpful?

    0 comments No comments