When i build the project at home i was facing a weird problem. I got a run time error:
"Could not load file or assembly or one of its dependencies"
This message drives me nuts. The problem was the Copy Local attribute of a referenced assembly file.
As you can see The Copy Local attribute is set to True in the property window of the reference assembly.
When you take a look in the project file (csproj) you see that <Private> is set True. This indicates that the assembly must be copied to the projects output directory.
<Reference Include="...>
<HintPath>..\Heihoeve.Module\bin\Debug\Heihoeve .Module.dll</HintPath>
<Private>True</Private>
</Reference>
But this True is not really True! The assembly was not copied at all to the Local output directory! That is why the system couldn't find the assembly file and gives the error message above.
The simplicity of the solution is inversely proportional to its maddening level:
1) Set the Copy Local attribute to False and build the project.
2) Set the Copy Local attribute to True and rebuild again.
Now the assembly is copied to the project output directory and the project runs successfull!
Geen opmerkingen:
Een reactie posten