While uploading my current project to our staging server I noticed that the Web.config file of my Asp.net MVC framework contains some references to assemblies called
- Hostadapters.AspNetAdapter
- QualityTools.Common
- QualityTools.ExecutionCommon
- QualityTools.Resource
I have not added the entries myself, but guessing from their names, I suspect these have been added by the “Add Unit Tests” Wizard.
The problem is, with these assemblies being referenced, the project does not run on my staging server, because it can’t find the relevant DLLs. Their paths are hard-coded into the
Web.config:
<httpModules>
<add name="HostAdapter" type="Microsoft.VisualStudio.TestTools.HostAdapter.Web.HttpModule, Microsoft.VisualStudio.QualityTools.HostAdapters.ASPNETAdapter, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</httpModules>
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.HostAdapters.ASPNETAdapter" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<codeBase version="10.0.0.0" href="file:///C:/Program%20Files%20(x86)/Microsoft%20Visual%20Studio%2010.0/Common7/IDE/PrivateAssemblies/Microsoft.VisualStudio.QualityTools.HostAdapters.ASPNETAdapter.DLL" />
</dependentAssembly>
Am I correct in thinking that these assemblies are Unit-Testing-Related?
When I tried to remove some of these entries, the server responded with an error 403 “Access Denied: Forbidden.” What might be the meaning of this, and how can I avoid it?
I could simply upload the referenced DLL files somewhere onto the server, but that seems counter-intuitive. Do I have other options?
Edit: I have read the suggestion to split configuration into separate parts. It is a good suggestion, but it doesn’t help me with my immediate problem of how the heck do I get any configuration working on the server?
I would have separate web.config files for staging and live regardless.
There are frequently many settings which need changing for development purposes, e.g. Cache lengths, security settings, urls etc.
From my experience, using the same config is a recipe for disaster – it takes 1 developer to change the settings to get something working locally, and then check the updated file in, and you end up with a broken staging server (or possibly live)!
If you use a build then it is simple to substitute web.config with web.live.config or web.staging.config during the build process.
Your problem then goes away.