Coruscate5
Coruscate5

Reputation: 2563

Visual Studio: Various Service/DLL Reference Errors in Project

When trying to build a solution I've recently downloaded from source control (TFS in this case), I'm having all sorts of issues which other developers are not.

Sometimes, the project will build. Other times, it will not.

In general, I'm unable to make any source code changes, because as soon as I do, all the web & service references in the project appear to be broken. Re-adding the references does not fix the issue.

The service reference errors will appear as "The type or namespace could not be found..", while at other times I will randomly get "Could not load file or assembly..".

What is going on here? It doesn't appear to be project configuration related.

Upvotes: 0

Views: 58

Answers (1)

Coruscate5
Coruscate5

Reputation: 2563

In this case, the overarching problem was Impersonation. The impersonation account was trying to access many local files during the build, which was surprising to me.

You can check if impersonation is used in a project/site by checking the web.config (that is used in your development mode - if you use web.config transformations check your Debug/Release configuration) for:

<identity impersonate="true" userName="XXXX" password="XXXX"/>

If impersonation is enabled, the impersonation account will need various access on your local machine.

In my case, the impersonation account needed full control to the following locations:

C:\Users\MYUSERNAME\Documents\IISExpress\
DRIVE:\SourceControlProjectLocation\
C:\Windows\Microsoft.NET\Framework
C:\Windows\Microsoft.NET\Framework64
C:\Windows\Microsoft.NET\Framework\VERSION
C:\Windows\Microsoft.NET\Framework64\VERSION
C:\Windows\Microsoft.NET\Framework\VERSION\Temporary ASP.NET Files
C:\Windows\Microsoft.NET\Framework64\VERSION\Temporary ASP.NET Files

This was a real pain because because inheritance was broken by default in many of these locations by Windows itself.

Upvotes: 0

Related Questions