1

I'm not an experienced web developer, I usually code apps but I've been asked to look at a website written in C#. I've got a copy of Visual Studio 2012 and I copied the source code into my c:\inetpub\wwwroot folder. When I tried to run it I got an error message about creating a virtual folder as an application so I installed IIS and then created a virtual folder off of wwwroot. That seemed to work as it ran but then crashed as the database was empty. When I corrected the error and tried to run again I got this error.

C:\inetpub\wwwroot\WebApplication2\obj\Debug\Package\PackageTmp\Web.config(36): Build (web): 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 have I missed as I've created the virtual directory? I tried deleting the first virtual directory and then creating another within the website folder. That worked again but when it crashed the same thing happened again. Why is this?

user616076
  • 3,907
  • 8
  • 38
  • 64
  • Possible duplicate of [Error to use a section registered as allowDefinition='MachineToApplication' beyond application level](http://stackoverflow.com/questions/9300927/error-to-use-a-section-registered-as-allowdefinition-machinetoapplication-beyo) – jtabuloc Feb 10 '17 at 17:59

1 Answers1

2

You don't say which version of IIS you are using.

In IIS Manager, when you right click the web site, choose Add Application rather than Add Virtual Directory. That should get you started. You should read up on your version of IIS, e.g., this is for IIS 7: https://technet.microsoft.com/en-us/library/cc772042(v=ws.10).aspx.

Polyfun
  • 9,479
  • 4
  • 31
  • 39