Which Files in a Visual C# Studio Project Don't Need to Be Versioned

Which files in a Visual C# Studio project don't need to be versioned?

Dont include
bin

obj

*.suo

*.user

_Resharper* (if you have Resharper)

Include
*.sln

*.csproj

You can also check the .gitignore file for visual studio projects on github.

Which c# project files should I version control?

You should include the Properties folder; it contains AssemblyInfo.cs (with all of the assembly attributes) and the project's default Resources and Settings files, if any.

You should also include the .sln file, if any.

Are all files within a C# Project necessary to put under version control?

Not everything under the project folder is a part of the project.

Looking in Visual Studio, in the Solution Explorer, you can see the files that are actually part of the project. In the folder, though, you have the bin and obj folders, which contain temporary and output files. You can also find any number of old files, remains, copied files - all of which aren't compiled and don't find their way to the final product.

Some languages or IDEs look at the folder content as part of the project. Visual Studio manages it internally, in the .CSPROJ files.

So, to answer your question, the files that should be part of source control are the .cs files, .csproj files, .sln, .config and other files that are compiled or part of the project content - scripts, images and so on. The best way not to miss anything, on one hand, and not to add extraneous files is to use a Visual Studio source-control plugin, and do the check-in/check-out operations within VS.

How does Visual Studio determine the C# version for a project and where is it stored?

You are working under the false assumption that your csproj file hasn't change. Try pressing save, you should see a difference in there, a line like this:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<LangVersion>6</LangVersion> <!-- This line -->
</PropertyGroup>

Working with multiple versions of Visual Studio

Do you often modify the projects?

You could simply work with your upgraded version of the csproj and sln files.
This way you would commit/check-in all changes to source code files except for the project files, which are not often modified anyway (except to add new files).

Then if you want to commit the changes in the project files, you'd work with an intermediate local VS2008 version of the file and line it up using your favorite diff/merge tools before eventually committing this VS2008 version. It would be some kind of local branch.

C# projects, proper versioning, company, etc on deployment

You can add a file as a link instead of the actual file. E.g, my solution could be:

Solution
- My Project
- Properties
- AssemblyInfo.cs
- SharedAssemblyInfo.cs (Linked)
- Solution Items
- SharedAssemblyInfo.cs

When you add an existing item to the solution, you can use the drop down arrow on the Add link, and select Add as Link. The SharedAssemblyInfo.cs file can contain common/shared assembly attributes, e.g.:

[assembly: AssemblyVersion("2.0.*")]
[assembly: AssemblyFileVersion("2.0.0.0")]

[assembly: AssemblyCompany("My Company")]

... etc. The project local can contain project specific attributes:

[assembly: AssemblyTitle("My Assembly")]

... etc.

Which files should be checked in to SVN from Visual Studio Project Files in C#/VB?

By using Ankhsvn, I didn't have to worry on which files to be checked in because this tool knows it all.



Related Topics



Leave a reply



Submit