none
Suppress CA Warning doesn't work in Visual Studio 2017 (C++/CLI project) RRS feed

  • Question

  • When I try to Suppress Warning > In Suppression File in my vcxproj (C++/CLI), I get an error message "A file with the name d:\path\to\ClassLibrary1\ already exists on disk." and then "Cannot suppress the warning".

    Is it a known limitation of Visual Studio 2017? Or am I missing some configuration?

    Steps to reproduce:

    - create vcxproj in Visual Studio 2017 15.4.1 with Code Analysis enabled;

    - modify the base "Microsoft Mixed (C++ /CLR) Recommended Rules to include CA1812;

    - add the following classes;

    - build Release configuration and try to suppress CA1812

    template<class T> private ref class Editable {
    public: virtual void BeginEdit() {  }
    protected: Editable() {};
    };
    
    namespace ClassLibrary1 {
    
      public interface class IPanelUser
      {
        property int UserID { int get(); void set(int); }
      };
    
      private ref class PanelUser : public  IPanelUser, Editable<int>
      {
      public:
        PanelUser()
        {
        };
    
        virtual property int UserID
        {
          int get() { return 0; }
          void set(int value) { }
        }
      };
    
      public ref class Project
      {
      public:
        IPanelUser^ GetUser() { return gcnew PanelUser(); }
      };
    }
    

    Sunday, October 22, 2017 12:04 PM

Answers

All replies