11

After searching the SO forum, I cannot find a working solution for my question. If you find one, I would really appreciate it.

In Visual Studio 2012, I am building a C# project. I get the following error:

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

I have this solution:

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

But, it does not work for me.

Actually, I have the 'Assemblyinfo.cs' in working directory, I can see it in VS solution explorer.

Community
  • 1
  • 1
user3440244
  • 371
  • 1
  • 3
  • 15
  • 4
    Place your csproj file here or on an external clipping tool. That will help us find our what's going on. – Anderson Matos Oct 29 '15 at 20:56
  • Without the .csproj, it's like shooting in the dark, but the error says, "Propeerties" with two e's. Perhaps, that's your problem? Maybe you need to rename it to Properties with one e? – Alon Catz Nov 01 '15 at 14:57
  • It also say assemblyinfo.cd, the OP can't type accurately. The file is created by the project template, very unlikely that that ever goes wrong. Checking the project into source control and forgetting about the Properties sub-directory, that's a mistake anybody can make. – Hans Passant Nov 03 '15 at 17:58

5 Answers5

1

Have you tried deleting the assemblyinfo.cs files and then trying Clean and Rebuild solution? If you don't need versioning this might help you.

Dennis van Gils
  • 3,487
  • 2
  • 14
  • 35
0

Have you tried a Clean Solution, followed by a Rebuild Solution?

The AssemblyInfo.cs file should be recreated on a build.

Karl Gjertsen
  • 4,690
  • 8
  • 41
  • 64
0

I got this error even after I tried to Clean and Build. I could also could see the AssemblyInfo.cs file. I found out that the build was interacting with a power shell script(not entirely sure how) in the solution directory.

Long story short, Every project, except the one I had added(where the problem was), was mentioned in that script. I added the missing info to that script and I could build again.

I doubt your case will be exactly the same, but I imagine there could be some script or something similar that handles/references all the projects, except the one where your problem persist. Try searching the files for the text of project names.

Ronnie W
  • 113
  • 1
  • 12
0

I have encountered this situation. I find out why. It is usually due to confusion between mscorlib.dll versions. There are two ways:

  1. Change assemblyinfo version from 1.0.0.0 to 1.* (change value to *). See link:

    MSBuild extensions AssemblyInfo fails with version number not valid

    Get an error when trying to set the build version with the AssemblyInfo Task

  2. The second way is simple, I have applied it successfully, that is reinstalling .Net Framework 3.5.

0

Clean and Rebuild did not help for me.

What helped was manually deleting ALL /obj and /bin files and then using Clean and Rebuild.

A Petrov
  • 417
  • 1
  • 9
  • 23