views:

4734

answers:

9

I've been trying to look through some projects on CodePlex to try to get a feel for how others design their applications. I've run into some trouble trying to open these projects in C# 2008 Express. When I open either the solution or csproj files, I'm confronted with this error message:

'Foo.csproj' cannot be opened because its project type (.csproj) is not supported by this version of the application.

To open it, please use a version that supports this type of project.

This doesn't happen when I open projects I created myself. The external projects are even auto-converted from 2005 when they're in that format, but choke when it tries to open the converted file.

Is this a limitation on the Express editions, or is there something I can do to fix this?

I tried searching with Google, but the results I found were less than helpful.

Thanks!

UPDATES:
@JaredPar asked for the specific project which I'm having difficulties opening.
The proverbial 'straw that broke the camels back' is called Continuum, but I've also encountered difficulties with other projects on CodePlex, and also with the Paint.NET source.

I've tried uninstalling and reinstalling, but the problem persists.

@brianpeiris requested the specs for my install:

Visual Studio
Microsoft Visual Studio 2008
Version 9.0.30729.1 SP
Microsoft .NET Framework
Version 3.5 SP1

Installed Edition: C# Express

Microsoft Visual C# 2008 91910-152-0000061-60196
Hotfix for Microsoft Visual C# 2008 Express Edition with SP1 - ENU (KB945282) KB945282
Hotfix for Microsoft Visual C# 2008 Express Edition with SP1 - ENU (KB946040) KB946040
Hotfix for Microsoft Visual C# 2008 Express Edition with SP1 - ENU (KB946308) KB946308
Hotfix for Microsoft Visual C# 2008 Express Edition with SP1 - ENU (KB947540) KB947540
Hotfix for Microsoft Visual C# 2008 Express Edition with SP1 - ENU (KB947789) KB947789

System
System:
Microsoft Windows XP
Professional
Version 2002
Service Pack 2

Computer
AMD Turion(tm) 64 X2 Mobile
Technology TL-50
1.60 GHz, 1.75 GB of RAM
Physical Address Extension

Also, I should note that I have tried reinstalling VS, which didn't work. I've also installed the Web Developer Express as well, and while I can open and run the project from there, C# continues to frustrate.

+1  A: 

Try opening your .csproj -file with a text-editor and remove the ProjectType element that has a GUID - its usually the first entry under the first PropertyGroup.

Source

Espo
The ProjectType entry that you have to remove is in the .csproj not the .sln. Does anyone know why this happens?
MrTelly
You are correct, I have updated my answer.
Espo
I removed the ProjectType element and tried again. No joy.
AgentConundrum
Sorry to hear that. Also try JaredPar's suggestion, the VSTS tests might be throwing you express-version of the edge.
Espo
+1  A: 

Are you trying to load a VSTS Unit Test project? VSTS Unit Tests projects are not supported in the Express versions of Visual Studio and will lead to this type of warning. You can edit the project file a little bit and get the project to load if you just want to view the source but you will be unable to load the tests.

EDIT

Clarified that I was speaking about VSTS test unit tests projects versus other types of unit tests projects.

JaredPar
Forgive my ignorance, but how to I know if this is a unit test project?
AgentConundrum
@AgentConundrum, do a search for [TestClass] in the code base. If it is present it's a unit test project
JaredPar
@JaredPar - Thanks for the suggestion, but I re-extracted all the code into a single directory and grepped (case insensitively) for this string, and no matches were found. I'm starting to think maybe I should try re-installing C#.
AgentConundrum
@AgentConundrum, if you don't mind posting, which project are you looking at on codeplex?
JaredPar
@JaredPar - The question has been updated with examples.
AgentConundrum
+1  A: 

Seems like your version of VS doesn't like the version of VS that created the .csproj.

You can try copying the header from a .csproj you created yourself into the file that isn't working. Extra points if you write a program in C# that does that for you.

One problem: if the file was created with VS 2005, you might want to modify the header to make it look as if it was still made by VS 2005, so that your VS will convert it safely. I suggest scouring the web for a .csproj made with VS 2005, and using the header from that.

Try downloading and re-installing Visual C# Express 2008. You might have installed a bad copy. Download it from the official site, with a simple google.

Do you have the correct .NET framework? The newest version is 3.5. If you have a lower version, it might cause VS to reject loading it. Even if you change the header to something like 2.0 or lower, the application will probably not even build because it was built with a higher version of .NET.

If all else fails, try installing Visual C# 2005.

Aethex
A: 

Depending on the project there are many updates that you may need to install such as silverlight, mvc.. visual studio c# express 2008 sp1.(there are cases where third party frameworks create these custom project templates.) There may be test projects that only a professional version of visual studio understands. What I find works best is to use sharp develop to open and work with these projects. SharpDevelop will not complain about the project file and in most cases if you have the correct dlls you can build the project as well.

Aaron Fischer
+3  A: 

The Continuum project's codebase is not too large. Try creating a new project in Visual C# Express and import the code manually. You'll probably have to add some references as well before you can build sucessfully.

Edit:

I just did this with the Continuum project.

Here's my process:

  • Download and extract Continuum-1.1.1-Source.zip
  • Delete Continuum.sln and Continuum.csproj
  • Create a new Windows Forms project in Visual C# Express called Continuum
  • Delete the default Form1.cs and Program.cs files and all the files under the "Properties" folder
  • Save the new project and solution inside the previously extracted "Continuum" folder
  • Enable "Show All Files" in the Solution Explorer
  • Include all files and folders except the "bin", "obj" and "CompliedBinary" folders
    • Don't forget to include all the files under the "Properties" folder
  • Add a reference to ZedGraph.dll (found under the "zedgraph_dll_v5.1.5" folder)
  • Build and enjoy

Further Edit:

Here's a Unix diff of the unedited Continuum sln and csproj files compared to the ones I create using the process mentioned above. (I've merged the file manually to pick out the real differences.) (Ignore the syntax highlighting.)

Continuum_original.csproj vs Continuum_new.csproj

6c6
    <ProductVersion>9.0.21022</ProductVersion>
---
    <ProductVersion>9.0.30729</ProductVersion>
8c8
    <ProjectGuid>{FD0F9C26-38BF-473F-8FD4-FDB1C7BEA600}</ProjectGuid>
---
    <ProjectGuid>{E3E4FFA5-0EC3-4F94-B842-33C7A49B7FF5}</ProjectGuid>
13c13
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
---
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
37a38,46
    <Reference Include="System.Core">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Xml.Linq">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
    <Reference Include="System.Data.DataSetExtensions">
      <RequiredTargetFramework>3.5</RequiredTargetFramework>
    </Reference>
225c234
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
---
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

Continuum_original.sln vs Continuum_new.sln

3,4c3,4
# Visual Studio 2008
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Continuum", "Continuum.csproj", "{FD0F9C26-38BF-473F-8FD4-FDB1C7BEA600}"
---
# Visual C# Express 2008
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Continuum", "Continuum.csproj", "{E3E4FFA5-0EC3-4F94-B842-33C7A49B7FF5}"
12,15c12,15
     {FD0F9C26-38BF-473F-8FD4-FDB1C7BEA600}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     {FD0F9C26-38BF-473F-8FD4-FDB1C7BEA600}.Debug|Any CPU.Build.0 = Debug|Any CPU
     {FD0F9C26-38BF-473F-8FD4-FDB1C7BEA600}.Release|Any CPU.ActiveCfg = Release|Any CPU
     {FD0F9C26-38BF-473F-8FD4-FDB1C7BEA600}.Release|Any CPU.Build.0 = Release|Any CPU
---
     {E3E4FFA5-0EC3-4F94-B842-33C7A49B7FF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     {E3E4FFA5-0EC3-4F94-B842-33C7A49B7FF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
     {E3E4FFA5-0EC3-4F94-B842-33C7A49B7FF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
     {E3E4FFA5-0EC3-4F94-B842-33C7A49B7FF5}.Release|Any CPU.Build.0 = Release|Any CPU

You'll notice that the files aren't significantly different and, as noted in the comments for this answer, I can actually open, compile and run the unedited Continuum 1.1.1 project! It appears the problem might be with the questioner's particular setup.

Here are my software and operating system version information:

Microsoft Visual Studio 2008 Version 9.0.30729.1 SP Microsoft .NET Framework Version 3.5 SP1

Installed Edition: C# Express

Microsoft Visual C# 2008
91910-152-0000061-60588 Microsoft Visual C# 2008

Hotfix for Microsoft Visual C# 2008 Express Edition with SP1 - ENU (KB945282) KB945282 For more information, visit http://support.microsoft.com/kb/945282.

Hotfix for Microsoft Visual C# 2008 Express Edition with SP1 - ENU (KB946040) KB946040 For more information, visit http://support.microsoft.com/kb/946040.

Hotfix for Microsoft Visual C# 2008 Express Edition with SP1 - ENU (KB946308) KB946308 For more information, visit http://support.microsoft.com/kb/946308.

Hotfix for Microsoft Visual C# 2008 Express Edition with SP1 - ENU (KB947540) KB947540 For more information, visit http://support.microsoft.com/kb/947540.

Hotfix for Microsoft Visual C# 2008 Express Edition with SP1 - ENU (KB947789) KB947789 For more information, visit http://support.microsoft.com/kb/947789.

OS Name Microsoft Windows Vista Version 6.0.6001 Service Pack 1 Build 6001

brianpeiris
For my own sanity, since so far it's seemed like I'm the only one that was having this issue, can you confirm that you encountered the same error message when trying to open the project unedited?
AgentConundrum
Hmm... I didn't actually try opening the unedited project at first! It *does* work (sorry about your sanity :P )!Here's the version of Visual C# Express I'm using:Microsoft Visual Studio 2008Version 9.0.30729.1 SPMicrosoft .NET FrameworkVersion 3.5 SP1(Microsoft Visual C# 2008 91910-152-0000061-60588)Also, as I mentioned in my answer. I dowloaded the latest version of Continuum (1.1.1)
brianpeiris
A: 

Try opening your project using a text editor and replace the contents of <ProductVersion > to the version your own project files create.

Anzurio
A: 

@brianpeiris almost had it:

Visual Studio/C# Express 2008 RTM is version 9.0.21022.8 while Visual Studio/C# Express 2008 SP1 is version 9.0.30729.1.

Try upgrading to Microsoft Visual Studio 2008 Express Editions with SP1. You might also want to read the Visual Studio Express with SP1 FAQ.

Olivier Dagenais
A: 

Warning: this is totally a hack, but: You might be able to edit the .csproj file and comment out the <ProjectTypeGuids>, like this:

<-- <ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> -->

That said, just commenting those out might replace your trouble opening the project with trouble compiling it, instead. A better approach would be to google the guids on that line. For example, if you google the above project type guids, you'll be able to figure out that the project uses XNA, which you could then download for C# 2008 Express.

ojrac
A: 

I faced this problem after installing the DB2 add-in for visual studio, (cannot be opened because its project type (.csproj) is not supported by this version of the application.), and I solved it by Following the steps. Click Start> All Programs > Visual Studio 2008 > Visual Studio Tools > Click Visual Studio 2008 Command Prompt. Type the below command and press enter.

devenv.exe /resetskippkgs

Executing this command should solve your problem.

houssam11350