Why does one of my project's GUIDs change when I build the project in VS 2005? - visual-studio

For two of my VS 2005 C++ projects, VS wants to write to the .sln file when I build the projects. I have got a number of other VS 2005 C++ projects where this is not the case. It is a problem as due to the fact that we have ClearCase source control integrated with our VS 2005 installations and when we try and run an overnight build via batch files, the build pauses as a ClearCase check out dialog box is displayed.
Looking at what VS is changing in the .sln files, it is the second GUID on the project line.
Before building:
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "InterCommClientB", "InterCommClientB.vcproj", "{A2AF232A-7F27-4340-81D5-8ABFD10994D2}"
After building:
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "InterCommClientB", "InterCommClientB.vcproj", "{67BE85B7-3234-484E-88FB-4F0E42096583}"
Any help gratefully received. I am new to VS 2005, as we have only recently migrated from VC++ 6.0, so apologies if I have missed something obvious.
We are running VS 2005 Professional Edition, with SP1 installed.
Regards,
Greg.

I had similar problem. It seems that when converting projects from old versions of VS (like 6 or 2003) VS 2010 is not adding Project GUID to the .vcxproj file. Because of that when you open solution including such project VS will recreate GUID for such project, and will change .sln file but will not change .vcxproj file. So another time you open such solution the situation will be the same and the .sln file may change again.
See this: http://connect.microsoft.com/VisualStudio/feedback/details/586258/missing-projectguid-in-vcxproj-files

I am guessing here, but it looks like some changes have been made to the InterCommClientB project(project, not the files in the project). When this happens the sln is updated, in this case only the project GUID.
My best guess to resolve this issue would be to manually build the solution and then checkin the changes. This way the sln file won't change on build.
My second best guess is that you already made this changes at your computer and it is working fine, but you did not get lattest version on the pc where you do the night build .

This might be totally out there - but sometimes Visual Studio fails to check-in a Solution file when it's been modified and while the Solution is open in Visual Studio. Try closing Visual Studio, and only then committing the Solution file.
If it isn't that, there might be some other agency causing the Solution file to need to change the GUIDs its using. In one instance, I was using .NET tools from National Instruments, and they has a licensing scheme that would trigger that sort of action (modification of extraneous files for not good reason) whenever I went to do a rebuild.
Please take a careful look at the output from the build (in the log, or the output window) - you may find some further clues there!

Related

Can open MVC4 solution in VS2010, but not in VS2012

Looked through some similar questions, could not find one that fits my case.
I have a solution that I created some time ago in VS 2010 (maybe originally in MVC2), and eventually upgraded to MVC4.
The solution works properly when opened with VS 2010, builds and runs - everything as expected.
To confirm that I use MVC4, I checked the properties of my System.Web.Mvc.dll. It appears to be 4.0.0.0
From this I assume that I have MVC4 successfully installed on the machine.
However, when I try to open the solution with VS 2012 I get the following infamous error
Full text:
Unsupported This version of Visual Studio does not have the following
project types installed or does not support them. You can still open
these projects in the version of Visual Studio in which they were
originally created.
- Recipes, "C:\ ... Copy\Recipes\Recipes.csproj"
I can also create a new MVC4 project using VS 2012, so I'm assuming I don't lack any tools VS 2012 needs.
What else could be the problem?
There's probably an entry in the <ProjectTypeGuids> element of the .csproj file that VS2012 doesn't recognize. I have a vague recollection there was some tooling identifier change but I can't recall specifically.
My suggestion would be to create a new project from scratch and then compare the <ProjectTypeGuids> elements in each .csproj file to try to figure out which one from the VS2010 project it doesn't like in VS2012. It's likely going to require some trial-and-error tweaking of the list so make a backup of the file first so you don't get yourself into a situation where you can't open it at all.
If you don't want to take that approach another option would be to create a new empty project and then import the individual files from the old project into the new, but that could obviously be quite time-consuming if it's a large project.

Converting VS2012 Solution to VS2010

I'm working in VB project with VS 2012 and after finish I try to add setup project.
I didn't find it (because the Setup Project was discontinued after VS2010) so I switched to VS2010 but the problem is the project wont open and I get this message:
The selected file is a solution file but was created by a newer
version of this application and cannot be opened.
I tried this article : http://www.codeproject.com/Tips/80953/Converting-VS2010-Solution-to-VS2008
and tried to convert from 2012 to 2010 but same message appears.
Open you solution file in notepad. Make 2 changes
Replace "Format Version 12.00" with "Format Version 11.00" (without quotes.)
Replace "# Visual Studio 2012" with "# Visual Studio 2010" (without quotes.)
Just to elaborate on Bhavin's excellent answer - editing the solution file works but you may still get the incompatible error (as David reported) if you had .NET 4.5 selected as the default .NET version in your VS2012 project and your VS2010 enviroment doesn't support that.
To quickly fix that, open the VS2012 .csproj file in a text editor and change the TargetFrameworkVersion down to 4.0 (from 4.5). VS2010 will then happily load the "edited" solution and projects.
You'll also have to edit an app.config files that have references to .NET 4.5 in a similar way to allow them to run on a .NET 4.0 environment.
I had a similar problem and none of the solutions above worked, so I went with an old standby that always works:
Rename the folder containing the project
Make a brand new project with the same name with 2010
Diff the two folders and->
Copy all source files directly
Ignore bin/debug/release etc
Diff the .csproj and copy over all lines that are relevant.
If the .sln file only has one project, ignore it. If it's complex, then diff it as well.
That almost always works if you've spent 10 minutes at it and can't get it.
Note that for similar problems with older versions (2008, 2005) you can usually get away with just changing the version in the .csproj and either changing the version in the .sln or discarding it, but this doesn't seem to work for 2013.
the simplest solution is.....open your website in vs2013 and go to Debug->WebsiteProperties (last option) a new window will open..
in this window go to "Build" option and change .net framework version from 4.5 to 4.0.....then select ok.
[note: this step will only work if your project does not have dependencies with vs2013...]
Now open your website in vs2010
Open the project file and not the solution. The project will be converted by the Wizard, and after converted, when you build the project, a new Solution will be generated as a VS2010 one.
Solution of VS2010 is supported by VS2012.
Solution of VS2012 isn't supported by VS2010
--> one-way upgrade only.
VS2012 doesn't support setup projects.
Find here more about VS2010/VS2012 compatibility: http://msdn.microsoft.com/en-us/library/hh266747(v=vs.110).aspx
Simple solution which worked for me.
Install Vim editor for windows.
Open VS 2012 project solution using Vim editor and modify the version targetting Visual studio solution 10.
Open solution with Visual studio 2010.. and continue with your work ;)

Work with VS 2010 on a project for VS 2005

I have a project on SourceSafe that the team work with VS 2005.
I have installed VS2010 and like some features of this version.
Is there a way that I keep the project to day with SourceSafe, but however work locally with VS2010.
Say, I could not add new files to solution, but at least obtain, modify and archive the existing ones.
You can update all of the source files pretty safely unless you're adding code that is new since VS 2005. The main difference between the VS versions is in the project, and the solution files. What you can do is make your local project and solution files writable, and then use your source control to modify the source files. When all is said and done though you'll want to build it in 2005 (with the SourceSafe versions of the project and solution files) to make sure it all still works.
Also note that the conversion utility in Visual Studio that converts projects from previous VS versions is only intended to convert projects from the previous version. Since VS 2010's previous version is VS 2008 and not VS 2005 you may have to perform manual changes on your solution and project settings to get everything to build. The main thing that comes to mind is how global include directories are handled. If you have access to VS 2008 convert it to that first, and then to VS 2010.
Besides targetting the 2.0 framework VS2010 will still let you use new language features so you have to be careful.
And as Ben Burnett said, the sourcesafe binding doens't have to be a problem as long as you don't check out project and solution files. You can remove the read only flag from them so VS2010 can edit them, but they don't need be be checked into sourcesafe.
But I really wonder which feature you like so much about VS2010 that you want to restrict yourself to not be able to add, remove or rename files from your project.

Visual Studio 2010 (beta 2) solution in Visual Studio 2008

Is there a way to open a solution-file saved in Visual studio 2010 beta 2 in Visual studio 2008?
... or maybe a way to convert it?
When i tried to open it in VS 2008 i get an error saying "The selected file is a solution file, but was created by a newer version of this application and cannot be opened."
If you open up the .csproj file in a text editor (it's just XML) you'll see a line like:
<ProductVersion>9.0.30729</ProductVersion>
(this is from a VS 2008 project)
The first line of a 2008 .sln file reads as follows:
Microsoft Visual Studio Solution File, Format Version 10.00
The 2010 version numbers will be different - just change them to these values (or the ones you get from creating a new 2008 project on your system).
Just take a backup of the files first.
It is not a supported scenario to open a .sln file created with 2010 in 2008. This is true for trying to open any .sln file saved in a newer version of Visual Studio with an older one.
What you can do is open up the .sln file in notepad and decrement the version number by 1. This will allow you to open the .sln file but the operation will still likely fail as you'll have to convert all of the projects as well.
I fought with this very problem today. What I did was create a VS2008 project and simply added in the files from the other project. Most code written in 2010 really doesn't use 2010 features--at least for the code I was looking at it imported the files without any problems.
Visual Studio's project and solution files are plain text.
You need to open the .sln and .csproj files in a text editor, compare the VS2010 versions to VS2008 versions, and modify the version numbers to match.
You'd have to compare the .sln and .*proj files schemas between the versions. I know that the structure is dramatically different from 2003 to 2008. In the end, you are better off creating a new project and copying the files over between the two
Why not create a new VS2008 solution manually and add in the source code instead of hacking at the .sln file. Remember VS2010 is early beta and not ready and the timeline for release has been pushed back due to the growing number of people complaining about it.
Hope this helps,
Best regards,
Tom.
While what other users have stated is true, if the project contains or (may not be 100% exact but look for something along those lines)
You will need to remove them as the syntax for 3.5 client, and 4.0 client is different in VS2010, than in 2008.

How can I stop Visual Studio automatically upgrading projects?

I'd like to give VS2k10 a shot, but I'm in a VS2k8 environment. I compared the upgraded project files in VS2k10 and the only difference was the updated version number - how can I stop VS from doing this?
Probably the only way to open the VS 2008 projects safely in VS 2010 will be to make a copy and open the copy in VS 2010. In my experience, it's impossible to revert back once you have opened a specific project in a later version of VS unless you feel like changing the version number in the project files.
This was true with the 2003 to 2005 switch, and also with the 2005 to 2008 switch.
It also does this for some 2K8 SP1 in some cases IIRC. How about just not checking in csproj files from 2k8 - you never know when you're going to hit a more complex case where you are actually hitting something 2kA specific, and by first making sure everything still works in 2k8 you'll prevent team confusion.
You can't stop VS from trying to upgrade the project. When VS detects that the project file is not high enough for it's version, it will force an upgrade. If you cancel it will then not allow you to open the project.
I find the best approach here is to use two project files; 1 for each version of visual studio. I usually just copy all of the project files, open one and rebuild the solution.

Resources