Sometimes, for unknown reasons, VS 2008 creates solution files led by a newline.
Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 [...]
This happened on various machines, and I have no idea why this is. A Google search did not yield any useful results.
Now, why do I worry about this? Because I can't open these solutions in Windows Explorer. I have to open VS, select File -> Open -> Solution and it works fine. But to open solutions from within Explorer, I have to edit the sln file and remove the leading newline.
Edit: After Leom's suggestion I tested a few times and found that the issue is solely dependent on the leading newline.
Edit: Interesting: VS 2010 displays the same behavior the other way around: It only works with a leading newline! At least on some solutions - on other solutions it's exactly the same as with VS 2008. I'm confused.
I too have observed strange behaviour regarding opening .sln file from explorer.
It seems the Visual Studio Version Selector doesn't trust the BOM and wants a leading new line, unless the file is in ANSI encoding, than the leading new line must be omitted.
You can see this yourself when doing a save as on the solution file and selecting a different encoding.
Could be some legacy stuff.
I too faced the same issue. I observed this scenario after doing a reverse merge using IBM rational clearcase. It introduced a blank line at the beginning of the ".sln" file during reverse merge. To resolve this I opened the sln file in an editor (i used VI) and removed the blank line and saved the file. Then the file opened up in visual studio with a double click.
I too have a blank line in my solution files, but I do not have this issue.
I did some digging, it appears that solution files actually launch the Visual Studio Version Selector, and the first 2 lines (not sure if it the actual first 2 lines, or the first 2 lines of text) of the .sln
file act as the input parameters for this selector.
There could have been a possible corruption of this executable.
In addition, you may try in Visual Studio Tools->Options->Environment->General and choose the "Restore File Assoications".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With