web deployment project won't compile when doing a web.config file section replacement on a custom section

The custom section in my web.config file looks like: 

    <section name="management" type="Integration.CustomConfiguration.ManagementSection, Integration.CustomConfiguration" />



The web project builds fine, however, when I attempt to build using a deployment project (so that I can do web.config file section replacements) I get the following error:

Error    34    An error occurred creating the configuration section handler for management: Could not load file or assembly 'Integration.CustomConfiguration' or one of its dependencies. The system cannot find the file specified. (C:\Documents and Settings\pmatic\Desktop\Management\Management.Web_deploy\Release\web.config line 24)    C:\Program Files\MSBuild\Microsoft\WebDeployment\v8.0\Microsoft.WebDeployment.targets    613    9    Management.Web_deploy

I'd prefer to avoid the GAC,

Thanks in advance :)
1/12/2007 5:08:07 PM
asp.net.vs-web-deploy-projects 789 articles. 0 followers. Follow

7 Replies

Similar Articles

[PageSpeed] 40
Get it on Google Play
Get it on Apple App Store

I am having the same problem, is there no one who knows how to solve this?
4/17/2007 8:11:34 PM

I contacted Scott Guthrie and he asked Bradley Bartz to help me out who sent me this: 

... the current implementation of the config section replacement task is using the Config API which relies on instantiating the types.  Because the log4net.dll is in the bin the MSBuild task fails to load this type when running under msbuild.exe.  One customer who had the same issue with log4net.dll worked around the problem by putting log4net.dll in the GAC.

I know other customers who have implemented their own msbuild task to do a simple text replacement on the xml document.

Here is what another customer did for the specific issue:

Decided to work around this problem by using the configSource attribute to specify an external file for the log4net section, and then use msbuild to copy the correct config file from the deployment configs sub folder at build time

<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
  <log4net configSource="log4Net.config">
    <add key="Environment" value="Development" />
       <compilation debug="false" />
       <authentication mode="Windows" />

Hope this helps, Brad.

This should work for you. Good luck. 


5/24/2007 1:27:44 PM

Thanks for sharing that workaround.  Worked great for me!


6/1/2007 4:07:44 PM

I have found that in order for this to work when adding a custom configuration to the GAC, you must add the version number and public key to the web.config configuration section. See http://forums.asp.net/p/1003600/1327015.aspx. I believe I also read somewhere that adding the assembly dll to the Framework's executable directory (C:\WINNT\Microsoft.NET\Framework\v2.0.50727) also solves the issue.



9/28/2007 3:38:07 PM

I too have this problem :( it's very very very frustrating! Like the initial post in this thread, i seriously do NOT want to put something into the GAC or have to copy the .dll to the root .NET version folder. That's just poor :(

Finally, i didn't really understand what 'Mufasa245' said. Are there any ways we can check to see why the .dll is not getting located, when it tries to do the custom configuration replacement stuff?

it's soooo frustrating!

- Pure Krome -
10/17/2007 2:16:00 AM
In other words, the build can't find the DLL since it does not load the files in the Bin during config section replacement. So, putting it in the GAC solves that.

If you don't want to do that, the other solution was to use an external configuration file (in other words, put the  body section *not* in web.config but in a config file *referenced* by web.config) to configure log4net. Then, in a post-build task, copy over the production version of the external, log4net-only config file overwriting the original external, log4net-only config file. You see, copying files around is easy, if you know how. It was just in-file replacement was difficult and that's why WDP has that feature. But, if you use an external config file for a section, you can still just replace the whole file.

To learn more, look up information on using external configuration files and how to customize the WDP build process. You edit the WDP XML file, which has some good example build tasks. ScottGu has a good post on his blog about configuring WDP that showed me how to do it.


10/18/2007 1:58:20 AM

I swear i tried adding the dll to the GAC and it didn't work. I eneded up having to put the dll into the same directory as the devenv.exe, close vs2005 and restart it.

now using the copy over file idea i think has serious merit! i might just look into that actually :) I tried reading all the stuff by the God, ScottyGu, but still had no luck. My component was a thing we bought called SlickUpload.


- Pure Krome -
10/18/2007 1:00:25 PM

Similar Artilces:

Web deployment projects and web.config file section replacement
Hi,I am trying to get to grips with the Web Deloyment projects and it keeps on failing to compile - falling over when it comes to the web.config file section replacement.Has anyone got this bit working?  I keep on getting the error:Error    1    web.config(1): error WDP00002: missing section appSetting.I'm wondering if it has anything to do with the format of the appSetting file I am using.I have added 'appSetting=/config/staging/appsettings.config;' to the deployment project and then have the appsettings.config file formatted like this:<?xml version="1....

Web Deployment Projects
I've been using the new beta of the Web Deployment Projects. Cool stuff. One problem I have with it is this. I have specified some Web.config file section replacements. It is working just great, except that in the web.config file replacement files, some have comments in them that are not copied into the final web.config file. I wish that they were. For example, here is a snippet from connectionStrings.config file that will be inserted into Web.config...<connectionStrings>  <!--If using Oracle, please use below uncomment below section         <ad...

Web Deployment Project - Config Properties
I'm using a Web Deployment Project to compile my web site. In the Property Pages - Configuration Properties - Deployment section, there is an option to 'Enable Web.config file section replacement'. I have this working to replace certain sections of my web.config for each build config (release/staging/dev). I think this makes sense so other developers do not have to remember to change the web.config file. HOWEVER, this only seems to work when replacing parts of web.config; such as appSettings, connectionString, etc. This would require me to have separate config files for each section and bui...

Web Deployment Projects: Web.config sections <system.web>
I like "Web Deployment Projects" a lot - WELL done!I encounter the following by trying to replace the system.web config section in Web.config.During the build I get   Web.config (1): error WDP00002: missing section system.web.I can replace other parts of the Web.config, like appSettings, connectionStrings and even system.runtime.remoting, but not system.web.Any ideas? Thankx! I think you have the honors of finding the first bug.  We're using Configuration.Sections[] to acess the replaceable sections and it doesn't appear to work with system.web.I'll enter the bug. ...

Web Deployment Project feature: partial replacement of web.config sections
Hi, I am using a web deployment project to deploy a web site in production. What I would like to do is set the cutomErrors tag under system.web without necessarily having to replace the entire system.web section. Right now, that doesn't seem to be supported. Thanks, SA. Correct - it is a limitation that you can only swap out entire sections in web.config upon deployment. -- Bash This posting is provided "AS IS" with no warranties, and confers no rights....

Hi,     I have a website developed using c# vs 2005 (.net 2.0) and i added a web deployment project to it. I also have a customconf.config file which is a replica of the web.config but with some changes in the connection strings. I specified in the property pages of the web deployment projects as "connectionStrings=customconf.config;" and the problem is that when I build this, it copies the customconf.config file to the build folder, deletes it (i saw it getting copied into the folder and then disappearing automatically!!) and says the customconf.config could not be found. ...

Web Deployment Project deploying files not included by Web Application Project
Recently my boss asked me to find a way to share a web site project between 2 separate projects which will only share a subset of the files in the folder.  I created 2 web applications projects in the folder and eliminated the web site project.  I discovered when I publish the web application projects, that it wasn't compiling the .as*x pages, so I looked into web deployment projects.  The problem I'm having with web deployment projects is that when I build them from the solution configuration, it copies all the files in the web project to the deployment folder and I c...

Web Deployment Project problems replacing sections in system.web
I downloaded the latest version of the deployment tool but I still can't get it to replace anything in the System.web section..  I have tried just replacing the one piece in the <system.web> section like system.web=newtheme.config where the file newtheme.config has this line: <pages theme="WildTheme"/> Then I tried replacing the entire system.web section by doing system.web=newsystem.config but that didn't work either.  I just get the error "missing section system.web." Has anyone got this to work?  The release notes says it is suppose to work. Thanks ...

Web deployment project tries to compile files EXCLUDED from web application project
I am confused about the compiling process. I have a solution with 3 projects:a. class library projectb. web application projectc. web deployment projectThings were fine with this until I added a new .aspx file to the web app (item b above). I decided it wasn't ready for inclusion yet so I marked it with "Exclude from project". Now these 3 files get a different icon and are in fact excluded from the web app project (i.e. after this Exclude, I can Build the web app project without any errors).  BUT - if I try to run the app or I try to Build Solution or if I try to Build the...

Help with web.config file section replacement (new web deployment proj)
Hi there,Can anyone help?I want to be able to replace my connectionstring from my web.config.From reading the white paper i specify a config file (text file) which i presume goes in the same directory as the web deployment project files???Then if i want to replace an entire section then i just do something like thisconnectionStrings=productionString.confor example which i am led to believe replaces the entire section so what does the file need to include also the <connectionStrings> and </connectionStrings>?????So if i have more than one connection string in there and i just want...

Web Project Conditional Compilation for Web Deployment Project
I need to compile a couple different configurations Release/Debug/etc. based on custom compilation constatns. My web pages code is based on the custom compilation constants. I wanted to modify web.config before compilation automatically, because the conditional Compilation Constants settings are moved to the web.config in VS 2005. The only way I found is to modify web.config before the build and modify back after the build is done. I created a custom class derived from Microsoft.Build.Utilities.Task. This class overrides the Execute() method. In this method I modify the specifed web.con...

Benefits of creating a Web Deployment project for a Setup project for a website vs a Web Setup project
I'm creating an installer for a website.The only thing I require as input from the user (in Custom Actions) is settings for the web.config. My initial approach was to create a Deployment project from my web project ans use this as input to the Setup project.Couldn't I use a Web Setup project instead of a Web Deployment + Setup project to do the same thing?Issues I have found with the Web Deployment is that I cannot edit it's contents at installation time, I'm taking user input at installation time to write to the web.config that the Installer uses but of course this file is embedded in the W...

Error when Deploying and Signing Web Application project with Web Deployment project
I have a Web Application project that needs to be deployed and signed using Web Deployment projects. When I delete the global.ascx file I'm able to do the deployment and sign the output assembly. The error I'm getting without signing the assemblies is "An error occurred when merging assemblies: ILMerge.Merge: The target assembly 'HelloWorld' lists itself as an external reference.” .  Global.ascx or .asax? The usual cause of a signing error is when a reference is not signed.  Is the global.asax.cs or .vb marked as conte...

Web Deployment Project / Setup Project and editable web.config
I'm working on an installer for a website. The Installer will prompt the user for the web settings such as as various AppSettings. How would you recommend implementing this? Below I describe my initial thoughts but they seem over complicated !!!! My first idea is to created the Web Deployment Project and create a web.config section overwrite file, and then using it in the usual manner to overwrite the web.config appSettings section at installation time.Property Pages->Deployment section to "appsettings=appsettings.config"Then to make this appsettings.config file editable by a Custom ...

Web resources about - web deployment project won't compile when doing a web.config file section replacement on a custom section - asp.net.vs-web-deploy-projects

The Replacements (band) - Wikipedia, the free encyclopedia
pioneers of alternative rock . The band was composed of the guitarist and vocalist Paul Westerberg , guitarist Bob Stinson , bass guitarist Tommy ...

Facebook’s Carolyn Everson To Spend Six Months In London, Hire Replacement For Joanna Shields
... Vice President of Global Marketing Solutions Carolyn Everson will relocate from New York to London for six months in an effort to find a replacement ...

Facebook Home: Replacement Home Screen for Android
Nicely-designed phone interface that I would personally never want to use. (They’re embedding Helvetica rather than using Google’s crummy Roboto. ...

The Replacements (@TheReplacements) on Twitter
Website has been fixed. Stay tuned to see what other shenanigans we may or may not have up our sleeves... theReplacementsOfficial.

App Store - The Complete Hair Replacement Guide
Get The Complete Hair Replacement Guide on the App Store. See screenshots and ratings, and read customer reviews.

The Replacements - Sixteen Blue (REMASTERED) - YouTube
Artist : The Replacements Album : Let it Be (REMASTERED) Year : 1984 Track : 10 Duration : 4:24 Songwritter : Paul Westerberg Sixteen Blue Hut..yeah..c'mon ...

Brad Haddin says players want Champions League replacement as carrot for Big Bash success
... tournament has taken away a sizeable financial incentive. Test retiree Brad Haddin says players hope administrators will establish a replacement ...

Big Bash League: Dick Smith collapse leaves Melbourne Stars searching for replacement key sponsor
... tumultuous week is on the cusp of returning to positive territory, with the Big Bash League team closing in on what would be a rapid replacement ...

Soundwave cancellation: Plan emerges to crowdfund replacement mini-festival
Bands unite to organise replacement concert tour to Soundwave Music Festival.

Harjit Sajjan Hints F-35 Won't Be Excluded From Jet Replacement Competition 34
One of the Liberals' top campaign pledges was to buy a less expensive aircraft.

Resources last updated: 1/14/2016 11:13:34 AM