In an application I am currently working on I have the need to programmatically add files to the csproj file. The task of doing this, in and of itself, is pretty straight forward. However, I'm having trouble finding any useful (and complete) documentation on the csproj file schema. Specifically, I am trying to determine all values that would be part of the SubType (attribute of File element) enumeration. Although I did find this xsd:
It does not contain an enumeration for the SubType attribute. After unsuccessfully googling this for hours last night I decided to just parse all my project files and find all unique subtypes. I parsed 73 files and came up with this list:
Code
code
Component
ASPXCodeBehind
Form
UserControl
Next I decided to parse the files again and determine SubTypes unique to file extenstions... Here is what I came up with:
Code - .cs, .asax.cs
code - .cs
Component - .cs, .asax
ASPXCodeBehind - .cs, .aspx.cs, .ascx.cs
Form - .aspx, .asmx
UserControl - .ascx
All the project files I parsed are VS 2003 projects and were generated by VS. Based on the results I found I can see no obvious rhyme or reason on how some of these SubTypes are determined. For example, .cs can be Code, code (different casing), Component, or ASPXCodeBehind. The component piece seems obvious enough, both asax and asax.cs are of Component SubType. Can anyone point me in the direction of useful documentation or explain to me exactly how these values are determined? It's important I maintain the integrity of our csproj files so although I feel I can make some assumptions I would rather know for sure.
Any help is appreciated.
Thanks,
-Kevin
It does not contain an enumeration for the SubType attribute. After unsuccessfully googling this for hours last night I decided to just parse all my project files and find all unique subtypes. I parsed 73 files and came up with this list:
Code
code
Component
ASPXCodeBehind
Form
UserControl
Next I decided to parse the files again and determine SubTypes unique to file extenstions... Here is what I came up with:
Code - .cs, .asax.cs
code - .cs
Component - .cs, .asax
ASPXCodeBehind - .cs, .aspx.cs, .ascx.cs
Form - .aspx, .asmx
UserControl - .ascx
All the project files I parsed are VS 2003 projects and were generated by VS. Based on the results I found I can see no obvious rhyme or reason on how some of these SubTypes are determined. For example, .cs can be Code, code (different casing), Component, or ASPXCodeBehind. The component piece seems obvious enough, both asax and asax.cs are of Component SubType. Can anyone point me in the direction of useful documentation or explain to me exactly how these values are determined? It's important I maintain the integrity of our csproj files so although I feel I can make some assumptions I would rather know for sure.
Any help is appreciated.
Thanks,
-Kevin