The source file 'Properties \ AssemblyInfo.cs' was not found.

I am running VS2010. When I open my web solution and try to build, the assembly fails with the error "CSC (0,0): error CS2001: Source file" Properties \ AssemblyInfo.cs "not found".

I created Windows applications, but in different solutions.

I can not find the link to this file in the web solution / project.

Ahiya, LarryR ...

+52
tfs visual-studio-2010
Jun 27 '11 at 2:47 a.m.
source share
3 answers

This is ringing. I encountered a similar problem in the past,

  • If you open the project’s “Properties” folder, you will see “AssemblyInfo.cs” if this is not a problem. The build information file consists of all build options for the project, including version, company name, GUID, compiler options .... etc.

You can create assemblyInfo.cs by right-clicking the project and selecting properties. On the application tab, fill in the data and click "Save", this will create the assemblyInfo.cs file for you. If after that you create your project, it should work.

Cheers, Tarun

Update 2016-07-08 :

For Visual Studio 2010 using the most recent version (2015 at the time of writing), LandedGently comments still apply:

After selecting the project properties and the Application tab as the mentioned @Tarun, there is a button "Assembly Information ...", which opens another dialog box. You should at least fill out the Title here. VS will add the GUID and versions, but if the title is empty, it will not create the AssemblyInfo.cs file.

+114
Jun 27 '11 at 17:38
source share
— -

This can also happen if you have a solution containing a project open in Visual Studio, and then use the source code management software to switch to an older commit that does not contain this project. This would usually be obvious, since all project files would also disappear. But if this is a new project with very few files or no files at all, it may seem perplexing to see that only this one AssemblyInfo.cs file is missing. And, most likely, you will mess with AssemblyInfo.cs when the project is new, so it may skip that another file or two is also missing.

We recover to do one of the following:

  • Extract the missing AssemblyInfo.cs and any other missing files from another commit, taking care to manage and save your .csproj file .csproj that the referenced files do not disappear from the project - perhaps by adding and removing a random .cs so that changes are needed to save (since visual studio believes that the .csproj file was saved when it did not).
  • Close and restart Visual Studio without saving (if the project file is not saved) or delete the project. Removing makes sense if you really do not want the project to be created yet, since it will be created later in the commit.
  • Create the AssemblyInfo.cs file manually. Just copy another project and change the details, especially the GUID, so that it matches one of the .sln file.
+1
Sep 06 '16 at 21:09
source share

I got an error using TFS, my AssemblyInfo was not displayed in the branch I was working on.

0
Sep 30 '14 at 7:58
source share



All Articles