Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Visual Studio solution (.sln) files have any hint to the machine they were created on?

My interest is in the first place regarding solution files containing C# projects.

Is there anything, like the exact .NET framework version, user names and passwords, any other information that can identify the machine the solution file was created on?

like image 923
TheDeparted Avatar asked Dec 23 '16 06:12

TheDeparted


People also ask

What .sln file contains?

sln file. The . sln file contains text-based information the environment uses to find and load the name-value parameters for the persisted data and the project VSPackages it references. When a user opens a solution, the environment cycles through the preSolution , Project , and postSolution information in the .

What does .sln file mean?

What is SLN file? A file with . SLN extension represents a Visual Studio solution file that keeps information about the organization of projects in a solution file. The contents of such a solution file are written in plain text inside the file and can be observed/edited by opening the file in any text editor.

Should I commit .sln file?

Yes, you always want to include the . sln file, it includes the links to all the projects that are in the solution. Show activity on this post. Under most circumstances, it's a good idea to commit .


2 Answers

No. Take a look at the file. It just enumerates all projects in your solution and their build configuration.

Places where you can find computer-specific stuff might be the project files and the .suo file (which you usually don't send to version control) and the PDBs of the compiled assemblies (they contain file paths, etc.).

like image 137
Patrick Hofman Avatar answered Oct 18 '22 21:10

Patrick Hofman


No, as Patrick Hofman has already answered, .sln file just contains a list of .csproj project files.

However,

  1. Exact target .NET Framework version is stored in .csproj files.
  2. Username isn't stored anywhere if you do not specify it yourself, except for different places like assembly references, PDB files, different configuration files, if you use user-specific pathes like C:\Users\yourusername\My Documents\Visual Studio Projects\ConsoleApplication1 etc.

    Also, note that there is a thing like file metadata. It is not related to Visual Studio at all, but it can store information about file creator. As for me, I see my computer name and domain username in Details tab of file properties.

  3. Connection strings are stored in .config (App.config, Web.config etc) files. You definitely wouldn't want to commit your login and password to a public database.

like image 3
Yeldar Kurmangaliyev Avatar answered Oct 18 '22 22:10

Yeldar Kurmangaliyev