locked
Suggestions on Web Deployment tool issue RRS feed

  • Question

  • User977421240 posted

    I have a central site where I host web apps I've built for our department. Two are hosted fine and am trying to get the third up right now and have an frustrating anomaly that I've been working on most of this week and not figured out as of yet.

    When I compare the content of each of the Features on the deployed apps between those that work fine but this one that fails (currently returning a 500 error) there are three Features that are different.

    .NET Authorization Rules

    Working: Has an Allow all users and Deny Anonymous Users
    Not Working: Has Allow all users

    Application Settings

    Working has:

    • ClientValidationEnabled true
    • UnobtrusiveJava ScriptEnabled true
    • Webpages:Enabled false
    • webpages:Version 3.0.0.0

    Not Working has nothing listed.

    Session State

    Working has: the Session State filled in completely.

    Not Working: Pulls up an error saying... Filename: \\?\C:inetpub\wwwroot\VulTrack\web.config, Line number: 60, Error: Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'DefaultSessionProvider'

    When I run the web deployment tool to push it to the server there are no errors and it consistently reports 100% success.

    Anyone have any clue what might be going on here?

    Friday, May 12, 2017 8:48 PM

Answers

  • User977421240 posted

    I was referred to a thread dealing with this on StackOverflow that had an answer that is working perfectly...

    I read through that thread and the section by section process wasn't working because of my 'runtime' section. Every time I tried to apply the inheritInChildApplications="false" to that section it would blow up. 
    
    Then I saw another answer down further that suggests creating a new app pool and adding enableConfigurationOverride="false" the app pool by editing %WINDIR%\System32\inetsrv\Config\applicationHost.config. Works perfectly!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 17, 2017 6:15 PM

All replies

  • User475983607 posted

    When I compare the content of each of the Features on the deployed apps between those that work fine but this one that fails (currently returning a 500 error) there are three Features that are different.

    That means the code has logical errors.

    Not Working: Pulls up an error saying... Filename: \\?\C:inetpub\wwwroot\VulTrack\web.config, Line number: 60, Error: Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'DefaultSessionProvider'

    You have a duplicate key.  Do you have web.configs in sub folders?

    Saturday, May 13, 2017 10:46 AM
  • User977421240 posted

    I was able to clear the error sighting the 'duplicate entry' in web config by removing the line referenced in the error above.  On doing so the Session State feature tab became usable.  However, this had no impact on the functionality of the app.  The same error was reported on attempting to access the web app.

    In regard to the 500 error and the likelihood of having logical errors in the code.  What perplexes me a bit about this is the fact that the two web apps in question (the one that works fine: developed earlier and redeployed as a test bed; and the current one that I'm trying to get working on the web server now)  Is the fact that VS 2017 reports no issues with the code and it executes perfectly in the dev environment on my workstation (just as the working app did and does).

    Monday, May 15, 2017 2:35 PM
  • User475983607 posted

    I was able to clear the error sighting the 'duplicate entry' in web config by removing the line referenced in the error above.  On doing so the Session State feature tab became usable.  However, this had no impact on the functionality of the app.  The same error was reported on attempting to access the web app.

    This is usually an indication that there is more than one web.config in the project as web.config settings are inherited.  It could simply mean that you have an duplicate in a single web.config too.  Or it could mean the machine config has this entry.

    I'm not sure what Session State tab you are referring to.

    In regard to the 500 error and the likelihood of having logical errors in the code. 

    A 500 status is an unhanded error where the server could not complete the response.  This is commonly due to configuration and logical bugs.  Sometimes these bugs do not show themselves until the code is moved to an actual remote server where the environment is much different than a workstation where the client and server are the same machine.

    Monday, May 15, 2017 3:10 PM
  • User977421240 posted

    I think I'm going to do a file system based deployment and see if I get the same results.  500 errors are almost as good as an 'unknown error'.  I'll validate the web config based on your comments before doing that but of course I was able to fix the issue with the one on the server side by removing line 60 where the duplicate appeared.

    Feels like I'm getting no where fast. <sigh>

    Monday, May 15, 2017 3:22 PM
  • User475983607 posted

    500 errors are almost as good as an 'unknown error'. 

    Often, 500 errors are logged in the event viewer.

    Monday, May 15, 2017 3:29 PM
  • User977421240 posted

    I've finally gotten past the issues above only to create some new ones that I'm working on... Bottom line is in order to fix the web app I had to lobotomize my web.config for the root web.. that crashes it but allows the app to work.  I fix the root web and there goes the app.  For some reason the web.config for the app is referencing the root web.config.  I have a head ache and going to call it a day. At least, I've now seen the app running on the web server. Now I just have to get everyone playing together nicely.

    Tuesday, May 16, 2017 8:13 PM
  • User475983607 posted

    I fix the root web and there goes the app.  For some reason the web.config for the app is referencing the root web.config. 

    I asked you twice if you had web.config files in sub folders.  I also explained web.config settings are inherited.  Maybe you did not understand what I was telling you?

    https://msdn.microsoft.com/en-us/library/ms178685.aspx

    Anyway, the machine.config is the main config file for the server.  The web.config found in the root of an application controls the app.  All sub folders inherit the root web.config settings (and machine.config). 

    Tuesday, May 16, 2017 8:25 PM
  • User977421240 posted

    No I guess in my frustration I totally glazed over it.  Maybe it wasn't such a good idea placing multiple web apps as sub folders on the web server.... Well I will worry about it in the morning. I've had enough for one day.

    Tuesday, May 16, 2017 8:49 PM
  • User977421240 posted

    I was referred to a thread dealing with this on StackOverflow that had an answer that is working perfectly...

    I read through that thread and the section by section process wasn't working because of my 'runtime' section. Every time I tried to apply the inheritInChildApplications="false" to that section it would blow up. 
    
    Then I saw another answer down further that suggests creating a new app pool and adding enableConfigurationOverride="false" the app pool by editing %WINDIR%\System32\inetsrv\Config\applicationHost.config. Works perfectly!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 17, 2017 6:15 PM