# What is Designer for in .csproj?

When I open a solution which consists of bunch of projects, sometimes I just edited one project and rebuild, the IDE asks me to save a bunch of file I didn't edit...

With some investigation,  I found out that somehow those csproj got "<SubType>Designer</SubType>" added...

What is this tab for in the csproj? What is the reason this was added and why this was not there at the beginning?

Is there a documentation about all tabs in csproj?

Thanks.

#### 7 Answers Found

Thanks for the links. However, after scanning thru them, I still think these answer my queries below,

What is this tag for in the csproj?

What is the reason this was added (i.e. What triggers <SubType>Designer</SubType> added to the csproj? )

and why this was not there at the beginning?

Can you help to elobarate more? Thanks.

Hi,

As I understand, the SDK document for the project SubType is very clear. Could you please clarify which part in this document you can't understand it? If you installed VS.NET 2005 in your PC, you can find project SubType sample codes in the default folder - "C:\Program Files\Visual Studio 2005 SDK\2007.02\VisualStudioIntegration\Archive\CS_Samples\ProjectSubtype\ProjectSubtype" provided in the SDK as your guide for much of the features you needed to implement. Besides, try to check out this blog about "VS 2005 Project Subtypes" for reference - http://weblogs.asp.net/rgillen/archive/2006/06/15/VS-2005-Project-Subtypes.aspx

Hope this helps,

Regards,

I am in exactly the same situation and don't think this thred answers the original question.

I use SVN for source control, when I get the solution from the repository and open it, VS tells me to reload some of the projects and on reload, the project file has changed. it has an extra line <Subtype>Designer</Subtype> and I do not want this line to automatically appear in my csproj file, what do I need to do?

I agree with Wood and sparkhi.

The question isn't "What are SubTypes and how do you use them".

The question is, "Why, when opening up a given .csproj, does this SubType block get inserted automatically by the IDE when it wasn't needed originally?"   What does this block do?  And why was it inserted by the IDE requiring a modification commit into source control?

FYI, this same problem exists in VS2008.

Has anyone resolved this?

We are experiencing the same thing in our development group now.  Sometimes it changes because the IDE ADDs these tags, other times it changes because the IDE REMOVES them.

Could it be related to a particular developer's IDE settings?  We have a team in Germany and a team in the US working on the same code base.  Some quick research shows that whenever a member of the German team commits a change to a csproj, the <SubType> flag is added.  When we get these files and build the projects in the US, the IDE removes these tags from the cproj file.

It's rather annoying to see changes to files that are not legitimate and it adds complexity to our revision tree in source control.  So I would ask the same question as the OP:

What triggers the insertion of this <SubType> block, why do some IDEs add it and others remove it, and is there a setting we can all set to make sure our environments are the same?

Thanks,

Josh

Surprise to see even after 2 years no one has explained a reason for it.

I got the same same "<SubType>Designer</SubType>" added in my code project automatically. and I am surprise too see that..

Has anyone get any answer yet..?

Thnx n Rgds

Nishant

### Create a new project type like .csproj

Hi,

Can somebody list out the steps to be followed to create a new custom project typelike .csproj so that we can define a project template for this type, and use it like the standard type.

We should be able to open the project projectname.mytype by double clicking and should open up in Visual studio. So it not just about creating a project template.

Any help greatly appreciated.

-Saju Mathew

### Pass a property from SLN to CSPROJ

I know you can declare GlobalSections in the SLN file to declare global properties but I can't seem to find a way to get at that property from inside the CSPROJ.  Anybody done this before?

### VS 2010 .csproj "MUST" convert to 4.0?

Hey,

So my question is, does VS2010 require .csproj files to be converted to 4.0? My issue is that I'm working on a 2.0(3.5)MVC site, and in the environment I'm using 4.0 doesn't response well. Is their a way that I can run a 2.0(mainly) or a 3.5 csproj file without converting?

-Thanks

### .csproj does not open in my silverlight 4.0 which i was created in silverlight 3.5

hello,

.csproj does not open in my silverlight 4.0 which i was created in silverlight 3.5....pls............urgent today...........................

### Can't Avoid the ProjectGuid from Being Changed in .csproj File

This is not strictly an issue with VS2005 and VSS, altho it only becomes an issue when using some kind of source control.  The nut of the problem is that I have two projects in a solution of about a dozen projects where the ProjectGuid in the .csproj field is changed simply by virtue of the solution being opened in VS2005 (SP1).  There are also other solutions containing the same projects which manifest the same behavior.

This has become a significant nuisance because when using VSS, it requires me to check out the csproj files upon opening the solution.  Other than the hassle, I try to avoid checkout/checkin of these project files because they do not merge well, and thus I prefer checkouts of these only when necessary to add files or change settings.  It seems somewhat pointless to keep churning the ProjectGuid for no apparent reason.

We are now in the midst of a transition to Subversion, and the same behavior manifests in that environment, it's just that since SVN does not do any real checkout a la VSS, these csproj files just keep changing on every VS2005 start, and SVN flags these for commital to the repository.

Hence, I don't think this is an issue with VSS (or SVN), but rather a VS2005 issue, but one that only is of concern when you care about how files are changing as you work.

For some more specifics, these two projects are both for C# DLLs, and they are referenced by other DLL and EXE projects within these solutions.  I have probably another dozen or so DLL projects that do not exhibit this quirk, and it is always the same two projects that have this among the several solutions I reference them in.

This seems to have started a few months ago when I restructured the source tree within VSS and moved all of the SLN files to the root node of the tree.  This resulted in virtually all the references to the sub projects needing to be re-pointed from the Settings tab within VS2005.  I don't think anything was unusual about these two projects during that change,

I've searched the web/forums quite a bit, but this does not seem to show up in my results.  So if anyone has any suggestions of what to try or where to look, it would be most appreciated.

### Installing VS 2008 Pro - unable to open .csproj files, no XNA templates

Hi,

I've installed VS 2008 Professional, but I can't open .csproj files and the XNA framework templates are missing from the new project dialog. When I open a .sln file of my current project, I get this dialog:

"The project file

C:\foo\bar.csproj cannot be opened

The project type is not supported by this installation"

I've done some searching and have tried the following steps:

1) Ran devenv.exe /resetskippkgs

2) Ran the manual SP1 installer from here: http://blogs.msdn.com/b/wpfsldesigner/archive/2010/01/13/vs2008faq.aspx

3) Tried to repair the install

4) repeated steps 1 and 2

I downloaded VS2008 from MSDN and verified the ISO. I burned the ISO to a DVD to install it (really wish there was an easier way of doing that). and when I installed it I allowed it to check the installation's integrity, so I don't think that I have a corrupted installation.

My system is running Windows 7 Home Premium 64 bit. I have the Express versions of VS 2005 and 2008 installed, along with XNA 3.0, 3.1, and 4.0 beta. I'd rather not uninstall and reinstall all of the previous XNA versions since it took a while to get them all working nicely together. ;)

Any ideas?

### csproj.user file under source control

Hi.
I have DSS project which I keep in source control (svn for the matter).
When DSS project is created a <Project>.csproj.user file is created with settings of how to strat dsshost for the project result dll - but this file, sence it's per user file, is not stored in the source control.
The result is that when I check out the project in clean machine I have to reenter the settings for each dss project.

How do you deal with it and how do you suggest me to deal with it?

Thank you,
Ido.

### Where is the CSC tag in the visual studio generated *.csproj

I have hand built a project file for msbuild.   I had to specify which files to complile and then specify a "CSC" ( c# compilek )task.   I don't see this in the visual studio generated file.  Why is the generated file so different?    Is there a document that shows what VS generates and how its used in msbuild?

Thanks

### Modify Custom Property without modifying csproj file

I have a custom property in my csproj file <MyIncludePath>C:\Temp</ MyIncludePath>.

<PropertyGroup>

< MyIncludePath > C:\Temp </ MyIncludePath >

</PropertyGroup>

<ItemGroup>

<Reference Include="MyDll">

<Name> MyDll </Name>

<HintPath>$( MyIncludePath)\ MyDll.dll</HintPath> <Private>False</Private> </Reference> </ItemGroup> I can override it with MsBuild with the /p:MyIncludePath=C:\NewPath. I have an addin using the VS Shell that can read and write to the custom property. But when I do this it changes the csproj file. Is there any way to modify the value in memory, then refresh the project to get it to update the include path. This would be simular to what I am doing with MsBuild from the command line. This is the code that works that modifies the project file. _serviceProvider = newServiceProvider(project.DTE asIServiceProvider); _sln = (IVsSolution)_serviceProvider.GetService(typeof(SVsSolution)); IVsHierarchy hiearachy = null; _sln.GetProjectOfUniqueName(project.FullName, out hiearachy); IVsBuildPropertyStorage buildPropStorage = (IVsBuildPropertyStorage)hiearachy; string propValue; buildPropStorage.GetPropertyValue("MyIncludePath", "", (uint)_PersistStorageType.PST_PROJECT_FILE, out propValue)) buildPropStorage.SetPropertyValue("MyIncludePath", "", (uint)_PersistStorageType.PST_PROJECT_FILE, @"C:\NewPath"); I could use the user file(_PersistStorageType.PST_USER_FILE) but then I would have to include it in the project file an make sure it is there. I am not sure how will that would work. The reason I don't want to modify the project file is because it is source controled. The user file is an option because it is not source controlled. Thanks Read more... ### references in project (.csproj) Hi , I'm using 'Developer Express .NET v8.2' dlls in our application, currently trying to automate the build process, so, for maintainability I want all third part dlls at one place in a build package (msbuild.....mage.exe), let say Local Assembly Cache. but when I checked in .csproj file I don't see the reference path, which it shows on properties of dll in solution under references, which could be updated via build ....msbuild. And, is there any better option to achieve above target? Read more... ### How to find broken references/ wrong version numbers in csproj files Hello i spent the last days with searching a problem in my addIn loading mechanism, because i alwayse got an exception if i tried to load some dll with MEF, after some minutes i checked out with AppDomain.CurrentDomain.AssemblyResolve event that MEF tires to load a dll with a old/wrong name. So i spent a whole day with searching the old reference ( .net reflector was very helpful) by hand. So knows anybody a fast or faster way to find broken references? please help, because i have the same problem again Read more... ### csproj is not supported by this version of Visual Studio 2008 Hello, When i try to open the project created in VS 2008 from my other team members, i am not able to open it. Below is the error message i am getting. ".csproj cannot be opened because its project type (.csproj) is not supported by this version of Visual Studio." I got a new machine in which i installed VS 2008 and VS 2005. When i try to create a new project File-> New -> Project, i see only project types are Business Intelligence Projects, Other Project Types (Visual Studio Solutions) I am thinking to uninstall VS 2008 and install again. Any ideas on what might have gone wrong. Planning to install the following from products web Product: VS 2008 Version: 9.0 Edition Team Suite Read more... ### Reloading .csproj elements I have added an <import> into my csproj file <Import Project="Build.targets" /> It works great... until I make a change to the Build.targets file. I then have to fully shut down visual studio in order for it to pick up the changes to the Build.targets file. Is there another way to do this other then adding my targets to the actual csproj? This just seemed like an easier solution then having to unload/reload the project in order to make a change. Read more... ### The project file '[ProjectName].csproj/' has been moved, renamed or is not on your computer I recently rebuilt my computer to Windows 7. We are using SourceSave 2005 and Visual Studio 2008. I am trying to add an Existing Project to a solution. I click on File | Add | Existing Project, select Microsoft Visual SourceSafe, select my VSS database. After I select the project (class library) I want to add I get the error message of 'The project file '[Name].csproj/' has been moved, renamed or is not on your computer. I am adding this to a new solution that has just a web site in it. I have tried deleting the suo file and that did not fix this issue. Read more... ### Create .sln and .csproj with 3.5 BuildEngine that also supports VS2005 Hello, I use 3.5 BuildEngine to create a solution and project file on the fly for .Net 3.5 library. The problem is that users must have VS2008 installed the open this solution. But many of them still have VS2005. Is there a way to create projects that can be opened on desktops that have VS2005 with .Net 3.5 installed? Thanks Martin Read more... ### Disabling Pre.Post-Build Events during Team Build 2010 at the .csproj level Hi, I'm trying to setup CI and one of my project is having a Post Build event to reset the IIS with noforce. I want this to happen when the developer builds this project locally and I want to disable when I queue a build in Team Build 2010. I have tried with multiple options like$(DesktopBuild), $(TeamBuildConstants) by adding conditions, but not succeeded. Please let me know if there is a better way. Thanks in Advance. Jags Read more... ### Unable to read the project file 'BlogManager.csproj' Here is the project that won't load from this MSDN article. Here is the download location. Visual Studio 2010 has no problem opening up BlogModel.cs into BlogModel.sln, the first text inserted below. But Visual Studio complains with the message One or more projects in the solution were not loaded correctly. The output window indicates.D:\BlogModel\BlogManager\BlogManager.csproj : error : Unable to read the project file 'BlogManager.csproj'. The offending csproject is listed at bottom. Thank you for any ideas! Greg Microsoft Visual Studio Solution File, Format Version 11.00 # Visual Studio 2010 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlogModel", "BlogModel\BlogModel.csproj", "{A3ABD179-C1A2-43E0-B3EC-C0F835CC03FE}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlogManager", "BlogManager\BlogManager.csproj", "{DF5C5712-9A6A-4258-B0BD-A0311FE4DECE}" EndProject <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>

<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion>8.0.50727</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{DF5C5712-9A6A-4258-B0BD-A0311FE4DECE}</ProjectGuid> <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>BlogManager</RootNamespace> <AssemblyName>BlogManager</AssemblyName> <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier> <TargetFrameworkVersion>v3.0</TargetFrameworkVersion> <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>

<SilverlightApplication>true</SilverlightApplication>

<SupportedCultures>

</SupportedCultures>

<XapOutputs>true</XapOutputs>

<GenerateSilverlightManifest>true</GenerateSilverlightManifest>

<XapFilename>BlogManager.xap</XapFilename>

<SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>

<SilverlightAppEntry>BlogManager.App</SilverlightAppEntry>

<TestPageFileName>BlogManagerTestPage.html</TestPageFileName>

<CreateTestPage>true</CreateTestPage>

<ValidateXaml>true</ValidateXaml>

<EnableOutOfBrowser>false</EnableOutOfBrowser>

<OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>

<UsePlatformExtensions>false</UsePlatformExtensions>

<ThrowErrorsInValidation>true</ThrowErrorsInValidation>

</PropertyGroup>

<!-- This property group is only here to support building this project using the

MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs

to set the TargetFrameworkVersion to v3.5 -->

<PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'"> <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>Bin\Debug</OutputPath> <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants> <NoStdLib>true</NoStdLib> <NoConfig>true</NoConfig> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>Bin\Release</OutputPath> <DefineConstants>TRACE;SILVERLIGHT</DefineConstants> <NoStdLib>true</NoStdLib> <NoConfig>true</NoConfig> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> <Reference Include="mscorlib" /> <Reference Include="System.ComponentModel.DataAnnotations, Version=2.0.5.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217" /> <Reference Include="System.Data.Services.Client, Version=2.0.5.0, Culture=neutral, processorArchitecture=MSIL" /> <Reference Include="System.Runtime.Serialization" /> <Reference Include="System.ServiceModel" /> <Reference Include="System.Windows" /> <Reference Include="system" /> <Reference Include="System.Core" /> <Reference Include="System.Net" /> <Reference Include="System.Windows.Controls, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> <Reference Include="System.Windows.Controls.Data, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" /> <Reference Include="System.Windows.Controls.Data.Input, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> <Reference Include="System.Xml" /> <Reference Include="System.Windows.Browser" /> </ItemGroup> <ItemGroup> <Compile Include="App.xaml.cs"> <DependentUpon>App.xaml</DependentUpon> </Compile> <Compile Include="MainPage.xaml.cs"> <DependentUpon>MainPage.xaml</DependentUpon> </Compile> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Service References\BlogService\Reference.cs"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> <DependentUpon>Reference.datasvcmap</DependentUpon> </Compile> </ItemGroup> <ItemGroup> <ApplicationDefinition Include="App.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </ApplicationDefinition> <Page Include="MainPage.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> </ItemGroup> <ItemGroup> <None Include="Properties\AppManifest.xml" /> <None Include="Service References\BlogService\service.edmx" /> </ItemGroup> <ItemGroup> <WCFMetadata Include="Service References\" /> </ItemGroup> <ItemGroup> <ServiceReferenceMetadataStorage Include="Service References\BlogService\"> <Type>datasvcmap</Type> </ServiceReferenceMetadataStorage> </ItemGroup> <ItemGroup> <None Include="Service References\BlogService\Reference.datasvcmap"> <Generator>DataServiceClientGenerator</Generator> <LastGenOutput>Reference.cs</LastGenOutput> </None> </ItemGroup> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />

<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

Other similar extension points exist, see Microsoft.Common.targets.

<Target Name="BeforeBuild">

</Target>

<Target Name="AfterBuild">

</Target>

-->

<ProjectExtensions>

<VisualStudio>

<FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">

<SilverlightProjectProperties />

</FlavorProperties>

</VisualStudio>

</ProjectExtensions>

</Project>

### project type (.csproj) is not supported by this version of the application

 Hi all, I am new to this forum and also to vb.net (am an ex vb6 programmer)..I installed visual studio 2010 premium edition and it works with my own projects BUT trying to open the microsoft Lab5 solution file I get this error:"/file cannot be opened because its project type (.csproj) is not supported by this version of the application"please Help...

### double click on existing csproj file to add it to current solution

I am creating a special "ubersolution" (same as described here : http://social.msdn.microsoft.com/forums/en-us/vstsstart/thread/C21D2E1D-F366-4FA1-B285-5B99A5E3AAD8 )

In VS2008, I could navigate in team explorer to the project folder and doule click on the csproj file to add it to the current solution.

For some reason this has been changed in VS2010, and double clicking on a csproj file is nowopening a new solution. Why would I ever want to do that?? Moreover it becomes VERY tedious to create a new solution with existing projects as soon as the numer of projects grows... Is there any way to add a lot of existing projects quickly? This is totally counter productive! is there any add-in knows that fixes this regression?

Stephane

### forcing subtype of a file (.csproj)

Hi,

I want to force a file to be shown as Code, but Visual Studio always change the <SubType> in the csproj file to Component.
This file contains a class derived from ListBox, but I don't change something on the UI, so I want it to be shown as code-file.
So I tried to change the SubType to Code, but VS changes it after every load of the project back to Component. How can I supress this behavor?

I'm using Visual Studio 2010 Professional

Thanks, Daniel