Solved

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.

Posted on 2014-03-19
13
433 Views
Last Modified: 2014-03-21
Hello Experts,

First, thank you for your time.

For testing purposes, within IIS I have created a local website called TestPublishing.  After configuring this new site, with what I think are correct settings, I tested the site.  I created an index.html file and placed it into the virtual directory.  The contents of the index.html file is:
<doctype />
<html>
<body>
    <h1>Test Publishing</h1>
</body>
</html>

Open in new window


I then went to the browser and typed in this url:  
http://localhost:84/TestPublishing/
And sure enough my index.html file is loaded and served up and Test Publishing is shown.  Yay!

Then, from Visual Studio when I publish an application to this url I get the following error:
It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS.

What do I need to give to you, in order for you to help me solve this (the steps I took to configure the site, the folder hierarchy, etc)?

Again, thank you for your time,
Michael Carr
0
Comment
Question by:MichaelDavidCarr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
13 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 39939886
Work through the details in this link to make sure your site is set up as an application, rather than as a static website:

http://www.iis.net/configreference/system.applicationhost/sites/site/application
0
 

Author Comment

by:MichaelDavidCarr
ID: 39940160
Thank you Carl,

I followed the instructions in the link you provided.  Now I am getting a different error:
Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'DomainServiceModule'.  Attached is the web.config file.

Thank you.
web.config
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 39940326
Try removing this line:
      <add name="DomainServiceModule" preCondition="managedHandler" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

Open in new window

From the <modules> element of your config file.
0
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 

Author Comment

by:MichaelDavidCarr
ID: 39940542
Thank you Carl,

I removed the DomainServiceModule line from web.confing and then it barked about the line just after that one the LightSwitchModule.  So I removed that one as well.  It continued to bark.  I then put the two lines back in and added <clear /> just above them.  That didn't work either.

The strange thing is I already have two other LightSwitch websites up and running on my local machine and I didn't run into this problem before.  Is there a way a tool that would allow me to compare iis website settings?

Thank you again.
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 39940578
It sounds more like an issue with your config rather than with the IIS setup itself. As long as the websites root folder is configured as an application then the rest should be down to the apps config itself.
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 39940580
Are all of these sites you have configured separately? You don't have more than one site published as sub directories of the same root site or anything like that?
0
 

Author Comment

by:MichaelDavidCarr
ID: 39940600
All of the sites are separate.  None of them are sub directories of the other ones.
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 39940621
Can you post a screen shot of the website settings page in IIS? I'd also compare the config file of this site with one of the ones that does work - paying special attention the the handlers sections.
0
 

Author Comment

by:MichaelDavidCarr
ID: 39940840
Hopefully this is what you asked for.  Now I will manually compare the web.config files.  I suspect though that the difference will be found in an iis configuration setting.
iis.png
0
 

Author Comment

by:MichaelDavidCarr
ID: 39941078
The two sites that work both have a virtual directory setting and neither of them have an Application defined.  But the site that doesn't work has an Application set but doesn't have a virtual directory setting.  Could this be the problem?  According to the documentation found in your article:  http://www.iis.net/configreference/system.applicationhost/sites/site/application it says to create an Application and doesn't say to create a virtual directory.  I am confused.
0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 39941133
You don't technically need a virtual directory if you're not using an application, and if you site physically sits under the root folder of IIS (i.e. somewhere under the c:\inetpub\wwwroot directory).

I'd remove the application firstly then and see what effect that has.
0
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 39943944
You just need to make sure that the website itself is configured as an application, and that there are no nested virtual directories configured underneath the site anywhere.

Also check that the handlers are configured to process anything with a .SVC extension in order the Lightswitch framework to function properly.
0
 

Author Closing Comment

by:MichaelDavidCarr
ID: 39946543
That was it!  Thank you very much Carl.
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New Relic: Our company recently started researching several products to figure out what were the best ways for us to increase our web page speed and to quickly identify performance problems that we may be having. One of the products we evaluated wa…
If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question