Export Visual Studio 2012 to 2010 sln format - visual-studio

My teacher is complaining that he can't read the VS2012 format on his VS2010 environment. I looked around in settings and so on but couldn't find anything. How can I give the project in an VS2010 readable format to my teacher?

Modifying sln manually
Backup your project folder (copy/paste to another location, like a folder called "backups")
Open sln file on wordpad
Change the "header" of opened sln to below (the first lines that matches mentioned lines below, except by version number/name):
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
I'll see if there is a way to do it in project options...

If the VS2010 installation has SP1 installed, then it should be able to read the VS2012 solution file.

Assuming this is not a terribly complex project (I'm making that assumption since there is a teacher involved), the easiest approach may be just to re-create the project in Visual Studio 2010.
Fire up VS2010, add your files, make any necessary changes to settings, and save.
You will need VS2010 no matter what approach you take. Even if you convert the project file by other means, it would be very wise to test it before handing it in again. The Express edition is free.

Another easy way to do it is to right click on the source code, open it with a program such as notepad, then save that on to a USB stick. When you go to class, copy and paste this into Visual Studio 2010 and viola.

Related

some solution files still have the VS10 icon

I have installed Visual Studio 2012 (aka 11) and uninstalled 2010. However I noticed that solution (.sln) files show an icon that has a little "10" on it while others have "11", with no seeming pattern. They are all solutions that I started out using in 2010 but have since worked on in 11. Why is this?
EDIT:
I noticed that I if I open the .sln file in a text editor, the "10" icon corresponds to:
Microsoft Visual Studio Solution File, Format Version 11.00
And the "11" icon corresponds to:
Microsoft Visual Studio Solution File, Format Version 12.00
Yes you read that right (!!!)
EDIT:
What if I change the .sln file in the text editor from 11.00 to 12.00? Is that recommended?
From what I've been able to figure out:
If you make any change inside Visual Studio that causes it to change the .sln file (i.e. adding a text file at the solution level, then deleting it, then doing "Save All"), the header of the .sln file will change to:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
and the icon will change to "11".
You can manually change the header if you want and the same thing will happen.
However, the icon and header really don't matter... you can leave it as is and everything will work fine because the file format is the same as VS2010.
I'm not sure what will happen if you change the headers to 12.00 as above and then try to open it in VS2010
Ignore the file format version number. It would have kept in sync with the VS version number, if it wasn't for VS2003, version 7.1. Essentially a major maintenance release for VS2002, the version that first introduced .NET support. So it's off-by-one right now.
The file format versions have increased with every VS release. That caused a lot of pain, when you worked in a team you'd have a pretty big headache if not all of the team members moved to the next version at the same time. Lots of questions about it at SO.
That changed in VS2012, it is the first version of VS that can read and write the solution and project files of the previous version. Which explains what you see, your VS2010 projects just never got converted, even after opening it in VS2012. Nice feature.

Loading Visual Studio 12 project in Visual Studio 10 [duplicate]

My teacher is complaining that he can't read the VS2012 format on his VS2010 environment. I looked around in settings and so on but couldn't find anything. How can I give the project in an VS2010 readable format to my teacher?
Modifying sln manually
Backup your project folder (copy/paste to another location, like a folder called "backups")
Open sln file on wordpad
Change the "header" of opened sln to below (the first lines that matches mentioned lines below, except by version number/name):
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
I'll see if there is a way to do it in project options...
If the VS2010 installation has SP1 installed, then it should be able to read the VS2012 solution file.
Assuming this is not a terribly complex project (I'm making that assumption since there is a teacher involved), the easiest approach may be just to re-create the project in Visual Studio 2010.
Fire up VS2010, add your files, make any necessary changes to settings, and save.
You will need VS2010 no matter what approach you take. Even if you convert the project file by other means, it would be very wise to test it before handing it in again. The Express edition is free.
Another easy way to do it is to right click on the source code, open it with a program such as notepad, then save that on to a USB stick. When you go to class, copy and paste this into Visual Studio 2010 and viola.

Visual Studio 2008 keeps adding 3 folders to solution folder prefixed with "Visual Studio"

For some reason, Visual Studio 2008 keeps adding three folders to my solution folder. I always have to delete them so I don't accidentally add them to SVN. How do I prevent these from being created? This happens about once every couple weeks, but I haven't figured out when it happens. We're probably going to convert all of our projects to Visual Studio 2010 later this year, but in the mean time, I'd like to figure this out.
If anyone knows how to write a Windows folder (or file) creation listener, I'll be able to track this down faster. I'm imagining a Windows Service that displays a popup when a folder gets created somewhere in the Windows file system, and it's constantly listening. I've had other situations where folders and files get created in Windows (in different project types in Visual Studio 2008 or Windows for that matter), so that might be a cool resource to have in the arsenal.
That directory is probably set as your VS Projects location. If you open Tools>Options and then click Projects and Solutions, it should show you the folder paths. VS will recreate these paths if you delete them.
After installing VS, they are usually set to something like:
C:\Users\username\Documents\Visual Studio 2010

How to create a new Visual Studio solution on the desktop using the context menu?

Years ago, using VS2005, I had a setup where I could right-click on the desktop/folder, select New, select Visual Studio 2005 solution and it would create a solution for me right there. I can't remember how I did this.
Does something like this exist for VS2008 or VS2010? It would be really handy.
EDIT: Figured it out based on the links in the answers (and also found an old email to myself).
1. Create a registry file (.reg) with the following content, then execute it:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.sln\ShellNew]
"FileName"="Visual Studio Solution.sln"
2. Create a new file called Visual Studio Solution.sln in C:\Windows\ShellNew folder with the following content:
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
3. Reboot Windows and you'll have yourself a context menu.
I used to use what I think you are looking for. It was done with a little registry update (.reg) file whose contents start like this
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.sln\ShellNew]
"Data"=hex:EF,BB,BF,D,A,4D,
of which this is just a snippet, and it was for an earlier version of VS. But this might be enough to jog your memory, or give you something to google for. See here for more
http://flux88.com/2009/03/right-click-new-visual-studio-solution/
edit..
also see http://visualstudiohacks.com/registry-hacks/create-solutions-without-folders/
I believe the Team Foundation Server edition of Visual Studio does that, either stand alone or with the Team Foundation Server Power Tools, which the Power Tools site says it has Windows Shell Extensions.
Also Codeplex hosts MSBuildShellExtension which is a little off topic for what your looking for, but its nice because it lets you build your project from any directory on your hard drive, without ever having to launch Visual Studio.
1) In Visual Studio 2010, use the "Blank Solution" project to create a solution.
2) Copy that SLN file into "%SystemRoot%\ShellNew".
3) In RegEdit, go to HKEY_CLASSES_ROOT.sln
4) If a key (folder) for "ShellNew" does not yet exist under .sln, create it.
5) Create a string value under ".sln" with a name of "Filename" and the filename of the SLN file for its data.
Done. No restart necessary.
REF: http://support.microsoft.com/kb/140333

How can I force Visual Studio 2010 to reload files and projects that have changed on disk?

I often use command line tools to do source control updates of files and projects that I have loaded into Visual Studio 2010. With previous releases when I did this I could force Visual Studio to notice and load the changes by doing a Save All. This doesn't seem to work in Visual Studio 2010.
I do have 'Detect when a file is changed outside the environment' checked in the Options window, but if I sit and wait it takes minutes or longer for the changes to be noticed.
How can I force 2010 to notice the changes in loaded source files and projects?
You can reforce reloading a project by unloading and loading the project.
Right-click the project and select Unload Project, then, when the project is unloaded right-click again and select Reload Project.
Note that this requires that all modified files in the project either be saved or the changes in the file be discarded.
It sounds like this could be the same problem that I experienced here. VS 2010 doesn't seem to pick up on file changes made outside the IDE (like if you add a file to the file system, and then click refresh in Visual Studio you don't see the new file, I experienced this on C++ projects).
You can refer here for the MS case, they claim they have fixed the problem in "the next VS release", which I assume would mean the first service pack for VS 2010.
Win7 shouldn't be a pre-requisite, though its possible an earlier edition (pre-SP1) of Visual Studio didn't work it. Upgrade always works, for reference the track changes option also needs to be turned on.

Resources