Source file 'Properties\AssemblyInfo.cs' could not be found

larryr picture larryr · Jun 27, 2011 · Viewed 107.8k times · Source

I'm running VS2010. When I open my web solution & attempt to build, the build fails with the error "CSC(0,0): error CS2001: Source file 'Properties\AssemblyInfo.cs' could not be found".

I have created Windows applications, but in different solutions.

I cannot find any reference to this file in the web solution/project.

Any help is appreciated.

Answer

Tarun Arora picture Tarun Arora · Jun 27, 2011

This rings a bell. I came across a similar problem in the past,

  • if you expand Properties folder of the project can you see 'AssemblyInfo.cs' if not that is where the problem is. An assembly info file consists of all of the build options for the project, including version, company name, GUID, compilers options....etc

You can generate an assemblyInfo.cs by right clicking the project and chosing properties. In the application tab fill in the details and press save, this will generate the assemblyInfo.cs file for you. If you build your project after that, it should work.

Cheers, Tarun

Update 2016-07-08:

For Visual Studio 2010 through the most recent version (2015 at time of writing), LandedGently's comment still applies:

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