8

I am working in Windows 8.1(64bit), VS 2013. I am building a project which is showing a warning like this. My project is working fine but anyway i need to remove this warning. Please help

warning MSB3305: Processing COM reference "NETCONLib" from path "C:\Windows\system32\hnetcfg.dll". At least one of the arguments for '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

Please help in solving this warning.. Thanks in advance

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
yemans
  • 917
  • 3
  • 12
  • 17

2 Answers2

9

IanG found a solution which did work for me, too:

I've added this in the PropertyGroup at the top of my .csproj file:

<ResolveComReferenceSilent>True</ResolveComReferenceSilent>

Keep in mind, that this will silence any warnings. If you happen to use features which are not meant to be used from managed code, then don't use this "solution".

MHolzmayr
  • 1,541
  • 1
  • 12
  • 22
-1

If you are sure that your project is working fine and you want to remove warning message only,
You can do it by using #pragma warning

http://msdn.microsoft.com/en-us//library/2c8f766e.aspx

hyun
  • 2,135
  • 2
  • 18
  • 20
  • Hi.. Thanks for the reply: I tried that one... That will work fine but is there any other way to remove this kind of warnings. I mean any changes in settings or something like that.. Hoping for a reply.. – yemans Mar 12 '14 at 13:53
  • Hi, actually I don't have any experience about `NETCONLib`. I just thought you want to remove the warning messages only. – hyun Mar 12 '14 at 15:01
  • Howerver, I searched some code related with `NETCONLib`, I found [this code](http://stackoverflow.com/questions/5917304/how-do-i-detect-a-disabled-network-interface-connection-from-a-windows-applicati). And when I built the sample code, I didn't any warning message. My build is 'vs2010/win32' on WIN7. I've used `INetConnection::GetProperties()` function also. I'm sorry but I think I couldn't help more – hyun Mar 12 '14 at 15:03
  • Hi.. No issues. I tried his, but not working as expected.. Finally am forced to supress warning using #pragma.. Thanks for the support – yemans Mar 14 '14 at 05:24
  • Thanks for your reply. I'm sorry about that. But, I think if your program is working well regardless of the MSBxxx warning, just removing the warning can be a good method. – hyun Mar 14 '14 at 07:30