0

I want to disable MSB3245 and MSB3243 warning and I tried to add below code to my .cs file

#pragma warning disable MSB3245
#pragma warning disable MSB3243

but it's not work

enter image description here

warning details

Severity    Code    Description Project File    Line    Suppression State
Warning MSB3245 Could not resolve this reference. Could not locate the assembly "System.IO.Compression". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.    MiniExcelLibs   C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets   2182    
Warning MSB3245 Could not resolve this reference. Could not locate the assembly "System.IO.Compression". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.    MiniExcelLibs   C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets   2182    
Warning MSB3243 No way to resolve conflict between "System.IO.Compression, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "System.IO.Compression". Choosing "System.IO.Compression, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily. MiniExcelLibs   C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets   2182    
Warning MSB3243 No way to resolve conflict between "System.IO.Compression, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "System.IO.Compression". Choosing "System.IO.Compression, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily. MiniExcelLibs   C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets   2182    


update:

Why I ask the question is from .net - Same version and publickeytoken but show "warning MSB3243: No way to resolve conflict between System.IO.Compression, Version=4.1.3.0" - Stack Overflow

It's conflict but it's work for asp.net core / asp.net platform well, so I want to miss the warning.

Wei Lin
  • 3,591
  • 2
  • 20
  • 52
  • If the Warning is about not compiling and not locating an assembly then why would you want to disable that? – Jeremy Thompson Mar 22 '21 at 04:31
  • @JeremyThompson System.IO.Compression it can usually be found in user client, and I don't want to specify version, – Wei Lin Mar 22 '21 at 05:54
  • Oh I see, you've got a conflict, you've done something like reference both DLLs: **No way to resolve conflict between** – Jeremy Thompson Mar 22 '21 at 05:57
  • @JeremyThompson yes, I ask few days age [link](https://stackoverflow.com/questions/66685505/same-version-and-publickeytoken-but-show-warning-msb3243-no-way-to-resolve-con) – Wei Lin Mar 22 '21 at 06:01
  • 1
    If you want to suppress warning and not fix problem https://stackoverflow.com/questions/1023858/how-to-suppress-specific-msbuild-warning – JL0PD Mar 22 '21 at 06:09

0 Answers0