Tuesday, 15 June 2010

visual studio - Using transformed Web.config with IIS Express during debug -


I have a visual studio application that has multiple solution configurations. Web for each configuration Confograph Transform file. For example, Web.Debug.config, Web.Release.config, etc.

We have some developers who are working on this project in which SQL Express is installed due to non-standard SQL Express examples and they run Web.Debug.config Instead of continuously editing, I have set up a solution configuration for each of them and have added the following to the bottom of the .csproj file. This code works in the web. Configurable and created in MyWebApp.dll.config vs. VS / obj / debug-developerName / folder.

Converted .. Config files are perfect, but IIS Express still uses Root Web.config (not transform).

Do these locally transmitted web while debugging? Is there any way to get IIS Express to use config files?

  & lt; Task Taskname = "Transforms ml" assembly file = "$ (MSBuildExtensionsPath) \ Microsoft \ VisualStudio \ v12.0 \ Web \ Microsoft.Web.Publishing.Tasks.dll" / & gt; & Lt; Goal name = "cockpill" canvp = "exists" ('web. $ (Configuration) .config') "& gt; & Lt ;! - Generate converted conversions in the Intermediate Directory - & gt; & Lt; TransformXml source = "Web.config" destination = "$ (intermediateoppath) $ (targetfilename) .config" transform = "web. $ (Configuration) .config" /> & Lt; / Target & gt;  

Web application web. Using Debug The conififf works for most of us, but not all.

Should there be a way to change the use of IIS Express during WebDebug-DeveloperName.config during local debug?

Is Transfolded Web.config to be copied to a separate folder?

I had to face this problem and I found a solution Unfortunately, the solution is different from the IIS configuration -Not based on compelling to use a different name, but if you follow the steps given below, you will simply select the configuration and will run the app (which you need me to have EVA). Web.config will be before conversion conversion and it will replace the original Web.config transformed by forest. Then, when the deployment (for local IIS Express) starts, it will already use Transed one.

Here is a step by step (a VS2012) how did I do a project (VS 2012):

  1. Right click on project and choose Unload
  2. Click again and edit
  3. Go to the bottom of the file and add it from the bottom right corner to the "" tag (this will be the last item)
  & lt; Import Project = "$ (MSBuildExtensionsPath32) \ Microsoft \ VisualStudio \ v $ (VisualStudioVersion) \ WebApplications \ Microsoft.WebApplication.targets" /> & Lt; Target name = "before" build "condition =" '$ (publishing profile name)' == '' and '$ (webpagefilefile)' == '' "& gt; & lt; TransformXml source =" Web.config "conversion = "Web. $ (Configuration) .config "destination =" web This is to prevent duplicate conversion if it is published in the "/">   

  1. Save the file, right-click on it and select Reload

Now, every time you run a build, your web configuration will be according to the selected configuration. Will be replaced.


No comments:

Post a Comment