Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide C# warning using project(.csproj) file

Tags:

c++

c#

One of C# project uses multiple C++ DLLs. I need to hide this warning the same project.

ALINK : warning AL1073: Referenced assembly 'mscorlib.dll' targets a different processor

I know it can be use C# code to do this using project file. But in my case I need to use project file to do this.

In C++ project file, It can be do by

<Link>
    <AdditionalOptions> /ignore:xxxx %(AdditionalOptions)</AdditionalOptions>
</Link>

I'm no so familiar with C#. Is there anyway to do this?

like image 473
Nayana Adassuriya Avatar asked Apr 10 '15 02:04

Nayana Adassuriya


People also ask

Can you hide the C drive?

(The corresponding decimal numbers: C - 4, D - 8, E - 16, F - 32, G - 64, H - 128...... If you are using another drive letter, you can reckon the corresponding decimal number.) If you want to hide C drive and D drive, you can type 12 (4+8). Step 6.

How do I hide C and D in group policy?

Open the following sections: User Configuration, Administrative Templates, Windows Components, and Windows Explorer. Click Hide these specified drives in My Computer. Click to select the Hide these specified drives in My Computer check box. Click the appropriate option in the drop-down box.


1 Answers

In the .csproj file
Add the tag <NoWarn>1073</NoWarn> to the desired build configuration in a <PropertyGroup> tag. Suppress multiple warnings by inserting a ;.

In Visual Studio
Right click the project -> property -> build tab enter image description here

You can explicitly specify the warning you would like to hide or lower the warning level to do that.

Please see the two posts below for reference:

  • https://msdn.microsoft.com/en-us/library/jj715718.aspx
  • https://msdn.microsoft.com/en-us/library/13b90fz7(v=vs.120).aspx
like image 191
woodwind Avatar answered Oct 19 '22 11:10

woodwind