Visual Studio "MSB4011" build *warning* - I want to DISABLE it

Julien Matthey 26 Reputation points
2022-04-23T13:03:04.37+00:00

Hello there,

Some of my projects include property files multiple times, I am aware of it and it is by design, so I want to DISABLE this warning.

The reason those property sheets are included multiple times is because I can include other property sheets in a property sheets, that I use for dependency management.

Example:

195767-props.png

Here the property sheet 'zlib' is included from the 'curl' property sheet and from 'zipfs->libzip' property sheet.

Every time I compile I get:

warning MSB4011: "C:\Users\jumat\repos2\include\zlib\zlib.props" ne peut pas être réimporté car il a déjà été importé à "C:\Users\jumat\repos2\include\libzip\libzip.props (4,5)". Il s'agit probablement d'une erreur de création de build. Cette importation est ignorée. [C:\Users\jumat\repos2\urlfs\urlfs\urlfs.vcxproj

How can I DISABLE MSB4011 WARNING? It's just a warning but still annoying.

Thank you.

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,519 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,882 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anna Xiu-MSFT 25,466 Reputation points Microsoft Vendor
    2022-04-25T10:06:20.077+00:00

    Hi @Julien Matthey ,

    Welcome to Microsoft Q&A!

    Please try to use the DisabledWarnings to disable the warning:

    <PropertyGroup>  
        <DisabledWarnings>4011</DisabledWarnings>  
    </PropertyGroup>  
    

    Sincerely,
    Anna
    *
    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Julien Matthey 26 Reputation points
    2022-04-25T16:48:35.613+00:00

    It doesn't work :-(

    I put

    <PropertyGroup>
    <DisabledWarnings>4011</DisabledWarnings>
    </PropertyGroup>

    in every included property sheet and I still get the warning.