Successful Visual Studio C # build does not create assembly

I am using Visual Studio 2005, .NET 2.0

I'm not sure yet under what circumstances this happens, but here is the scenario: I have a solution with this project structure: Library project Foo, library project panel that references Foo, and Quux library project that references Foo and Bar.

Compilation failed with the error message "Metadata file" Foo.dll not found "from" Bar ", and" Metadata file "Foo.dll" not found "and" Metadata file "Bar.dll" could not be found "from Quux .

In my destination directory (I have a combined destination directory for all three projects), it is empty, so no project is compiled at all. Now I can get Bar and Quux to fail if there is no way out of Foo. The problem is this: why does Foo fail silently? There is no mistake from this, and just creating Foo instead of the whole solution works great.

The funniest thing is, after you just clicked the build button, the Foo.dll file appears, Bar no longer complains, but does not generate any output file, and Quux complains about the absence of Bar.dll. By clicking the button again, Bar.dll appears, there are no more errors, but Quux.dll is missing. Only after clicking the button, Quux.dll appears again, again without errors.

Project dependencies are set correctly, the build order of the solution says exactly what you need.

I even tried to create a new solution and new project files, and then add the sources again. No joy. The same thing is happening.

I am completely at a dead end. Does anyone know a way out of this mess?

+3
source share
6 answers

You must have a separate output directory for each project. Each time a project is built, it cleans the output directory, so it will not find any dependencies on the following.

Do not be afraid to lose the DLLs, they will be copied to each bin directory where they are needed.

+4
source

, -, DLL .

, , bin . , , , , . .

, DLL .

, , post-build wrok; .

,

+1

- . - , . , .

0

, , . , ?

0

""

Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" 

0

For unknown reasons, this happened to me with Visual Studio 2013 in the middle of the morning work. One assembly, this is updating the dll, and then it just wasn't there, although the assembly seemed to go smoothly. I finally turned to him, deleting the existing dll. Without a pre-existing dll, the assembly should have provided a new one.

0
source

Source: https://habr.com/ru/post/1703416/


All Articles