I use WatiN and Cassini-dev in my integration tests, and I have had to deal with similar problems. In my configuration device, I deploy my Asp.Net web application to a temporary folder in the test folder, which allows me to play with the configuration before running cassini-dev. I use Windsor for my CI, which allows me to modify the input components at the configuration level. You can also achieve this with Unity .
, , -, -, , .
, :
- - temp
- - Asp.Net temp ( MSBuild)
- ( MSbuild , )
- temp (. , )
- web.config - Asp.Net, temp , .
- Cassini-Dev. HTTP-, , .
.
.
- cassini-dev
- temp. SMO Sql, Sql-, , - .
- MSbuild
var properties = new Dictionary<string, string>
{
{"Configuration", isDebug ? "Debug" : "Release"},
{"WebProjectOutputDir", tempHostingDirectory.FullName},
{"DeployToDatabase", "true"},
{"OutDir", Path.Combine(tempHostingDirectory.FullName, "bin\\")}
};
using (var engine = new ProjectCollection(properties))
{
engine
.LoadProject(<web project path>, "4.0")
.Build(new[] {"Build", "ResolveReferences", "_CopyWebApplication"});
}
Unity: http://www.pnpguidance.net/Post/UnityContainerUnityConfigurationSectionAppConfigWebConfig.aspx
asp.net : http://bronumski.blogspot.com/2011/06/generating-creating-aspnet-application.html
Msbuild ProjectCollection MSDN: http://msdn.microsoft.com/en-us/library/microsoft.build.evaluation.projectcollection.aspx