VS2005: Assembly '<assembly>' is incorrectly specified as a file.

Visual StudioVisual Studio-2005BuildAssembliesLog4net

Visual Studio Problem Overview


I've added a reference to the log4net assembly dll to my project.

When I build I get a warning saying:

> Warning Assembly 'Lib\log4net.dll' is > incorrectly specified as a file.

I look up the help for this error on MSDN, and it says:

> This warning is generated during > application manifest generation when > the build process detects that a file > reference is actually a (managed or > native) assembly.

This is exactly what I'm doing; the file reference is an assembly. What am I being told here?

How do I add a reference to an assembly dll, while not adding a reference to an assembly dll?

Visual Studio Solutions


Solution 1 - Visual Studio

Try setting the Build Action property of the source DLLs to None. It solved the issue for us.

Solution 2 - Visual Studio

I was running into this problem myself.

This is what worked for me:

I had added an assembly as a reference and as an "Existing Resource." Deleting the file from the Solution Explorer, closing, then reopening the project worked.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionIan BoydView Question on Stackoverflow
Solution 1 - Visual StudioMuhammad Ousama GhazaliView Answer on Stackoverflow
Solution 2 - Visual StudiojadelaneView Answer on Stackoverflow