Reputation: 1856
I have the solution, which has 5 projects. One of them: "Project.Core.Common" (.NEt Framework 3.5). I have a problem in them. When I try to compile, then I get error:
Error 79 The type or namespace name 'Server' does not exist in the namespace 'DllFile.Logging' (are you missing an assembly reference?) D:\Solution\Project.Core.Common
But this namespace DllFile.Logging.Server
exists. I can see it by opening DllFile.dll
in Object Browser.
Reference to DllFile.dll
added in my project.
DllFile.dll
has .NET FW 2.0.50727 runtime version.
I get 74 warnings about this DllFile.dll
:
Warning 4 The primary reference "DllFile.Logging.Server, Version=6.3.1.0, Culture=neutral, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework. Project.Core.Common
But DllFile.dll
doesn't use any dependencies to 4th framework. It written in 2.0 framework.
And the important thing: this project compiles without any errors on any computer except mine. I checked to compile it in the following environments:
VS 2010 (Windows XP SP3 x86)
VS 2010 (Windows 7 x86)
VS 2010 (Windows 7 x64)
VS 2013 (Windows 8.1 x64)
On every computer this project compiles fine. But on my computer (VS 2010 Windows XP SP3 x86) I get this error and warnings.
What I tried to do:
C:\Documents and Settings\User\Local Settings\Application Data\assembly
C:\Documents and Settings\User\Local Settings\Application Data\cache (deleted just in case)
C:\Documents and Settings\User\Local Settings\Application Data\Microsoft\Team Foundation
C:\Documents and Settings\User\Local Settings\Application Data\Microsoft\VisualStudio
C:\Documents and Settings\User\Local Settings\Application Data\Microsoft\VSCommon
C:\Documents and Settings\User\Local Settings\Application Data\WebsiteCache\
C:\Documents and Settings\User\VSWebCache
C:\Documents and Settings\All Users\Application Data\Microsoft\VSTAHost\SSIS_ScriptTask\9.0\ItemTemplatesCache
C:\Documents and Settings\All Users\Application Data\Microsoft\VSTAHost\SSIS_ScriptTask\9.0\ProjectTemplatesCache
C:\Documents and Settings\All Users\Application Data\VS\vs10sp1\SetupCache
C:\Documents and Settings\All Users\Application Data\Microsoft\VisualStudio\10.0\vs000223.dat C:\Documents and Settings\All Users\Application Data\Microsoft\VisualStudio\10.0\1033\devenv.CTM C:\Documents and Settings\All Users\Application Data\Microsoft\VisualStudio\10.0\1033\ResourceCache.dll C:\Documents and Settings\All Users\Application Data\Microsoft\VSA\9.0\1033\ResourceCache.dll C:\Documents and Settings\All Users\Application Data\Microsoft\VSA\9.0\1033\vsaenv10.CTM C:\Documents and Settings\All Users\Application Data\Microsoft\VSTAHost\SSIS_ScriptComponent\9.0\1033\ResourceCache.dll C:\Documents and Settings\All Users\Application Data\Microsoft\VSTAHost\SSIS_ScriptTask\9.0\1033\ResourceCache.dll
C:\Documents and Settings\User\Local Settings\Temp
cd C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE devenv /resetuserdata
But nothing helps.
What else can I to do to resolve my strange problem? (except reinstalling Windows)
Edited:
Changing the property 'Copy local' (true/false) for the reference 'DllFile.dll' not helps.
I tried to create the new empty project and add reference to this library 'DllFile.dll' and this error exists in the empty project too. So the problem is not in my real project.
Upvotes: 0
Views: 2707
Reputation: 1
This is an old bug that exists even in Visual Studio 2019 (Community Edition). The IDE do not update the project file of a project from which you're making a reference to another. But in a settings you're seeing as if the link is there. You should add the reference manually:
Write this to a project file (or can copy from another project where links is working fine):
<ItemGroup>
<ProjectReference Include="...path...\YourProject.csproj" />
</ItemGroup>
This fixes the problem.
Upvotes: 0
Reputation: 53
Go to your Solution Explorer and select Show All Files. Then come to your project bin and expand DllFile.dll and see there is DllFile.dll.refresh file and if yes then delete and clean the solution and rebuild your projects should build successfully.
Upvotes: 1