WCF Services in ASP MVC PRoject (NopCommerce)
Asked Answered
A

2

1

I am trying to add a WCF Service to the Admin Folder of NopCommerce . I have done the same thing for the web folder and every thing goes Well, but for Admin folder when I try to execute I have this 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. In the XML File here is the problem :< serviceHostingEnvironment multipleSiteBindingsEnabled="true">

I have tried several solutions but nothing works. Thanks in advance

Antoinette answered 23/11, 2011 at 19:5 Comment(0)
F
2

I just ran into this in one of our MVC projects, and it was due to having the MvcBuildViews property in the project file set to true. Setting the property to false fixed the problem.

<MvcBuildViews>false</MvcBuildViews>

EDIT: I also noticed this answer which outlines an alternative that does not require turning off view building.

Footpound answered 1/12, 2011 at 18:51 Comment(0)
L
0

As I'm not sure what you have tried till now, this is my guess:

You virtual directory is not configured as an application, thus it is failed to execute as a service.

Configure this as an application.

Right click on the application directory in IIS and convert it to application. Also, assign right application pool to it.

See the below url for reference on how to configure a vir directory as an application in IIS7

http://msdn.microsoft.com/en-us/library/bb763173.aspx

Lawrenson answered 23/11, 2011 at 23:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.