Where can I find the schema (XSD) for a .csproj file?

前端 未结 5 1088
小蘑菇
小蘑菇 2020-12-09 09:38

Where can I find the W3C XML Schema (XSD) for a .csproj file, for Visual Studio 2008?

It seems like this should be obvious, but I spent some time and haven\'t found

相关标签:
5条回答
  • 2020-12-09 10:14

    msbuild v14 is now:

    C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild
    
    0 讨论(0)
  • 2020-12-09 10:17

    The easiest way to figure this out is to unload that project in Visual Studio, then right-click and edit the csproj file.

    1. Open the Visual Studio Solution
    2. Unload one of the projects
    3. Right-click on the unloaded project in the "Solution Explorer" pane
    4. Click "Edit PROJECT_NAME.csproj"
    5. Open the "Properties" pane in Visual Studio
    6. Click anywhere inside the editor pane for the .csproj file
    7. The "Properties" pane should update with different information
    8. Look in the "Schemas" for a list of schemas that apply to that .csproj file

    I tried this in Visual Studio 2013, but this should apply to multiple versions of Visual Studio, since at this point the .csproj file is treated like any other XML file.

    0 讨论(0)
  • 2020-12-09 10:17

    The csproj files are MSBuild files so you should use the schema for MSBuild which is in:

    %VS2008%\Xml\Schemas\1033\MSBuild\Microsoft.Build.Core.xsd
    
    0 讨论(0)
  • 2020-12-09 10:20

    The csproj files are in fact MSBuild files. The xsd for those can be found here:

    %windir%\Microsoft.NET\Framework\[framework version]\Microsoft.Build.xsd
    
    0 讨论(0)
  • 2020-12-09 10:25

    I was able to find it in %VS2008%\Xml\Schemas\1033\MSBuild\Microsoft.Build.Core.xsd. The target namespace matches the project files' namespace, and the structure looks right.

    0 讨论(0)
提交回复
热议问题