nuget 'packages' element is not declared warning

后端 未结 7 1647
猫巷女王i
猫巷女王i 2020-12-07 10:05

not a showstopper but when using nuget in a project, it creates a packages.config file with this shape


7条回答
  •  青春惊慌失措
    2020-12-07 10:49

    You can always make simple xsd schema for 'packages.config' to get rid of this warning. To do this, create file named "packages.xsd":

    
    
      
        
          
            
              
                
                
                
                
              
            
          
        
      
    
    

    Location of this file (two options)

    • In the same folder as 'packages.config' file,
    • If you want to share packages.xsd across multiple projects, move it to the Visual Studio Schemas folder (the path may slightly differ, it's D:\Program Files (x86)\Microsoft Visual Studio 10.0\Xml\Schemas for me).

    Then, edit tag in packages.config file (add xmlns attribute):

    
    

    Now the warning should disappear (even if packages.config file is open in Visual Studio).

提交回复
热议问题