Try our conversational search powered by Generative AI!

Web Application as Virtual Directory of EPiServer site in IIS



I have an EPiServer CMS 6 R2 site running fine in IIS 7. However I wish to add another web application as a virtual directory within that EPiServer site in IIS.

I have ensured that the path to this virtual directory is excluded by EPiServer in the URLRewriter. When I try to hit the URL of the web application I have added, I get the following error:

CS1519: Invalid token ',' in class, struct, or interface member declaration

Has anyone ever managed to successfully add a web application as a virtual directory of an EPiServer site in IIS before?


Aug 23, 2011 18:09

In the child virtual folder wrap the <system.web> and <system.webServer> elements as follows:

<location path="." inheritInChildApplications="false">
    <!-- ... -->


<location path="." inheritInChildApplications="false"> 
    <!-- ... -->

This should stop you inheriting settings from the parent application.

Edited, Aug 23, 2011 23:29

Thanks for your response David. I tried your suggestion but unfortunately it didn't work.

Do you mean add the lines of code you suggested in the web.config of the EPiServer site, or the virtual folder site? And I assume I should replace path="." with path="myvirtualfolderpath"?

Aug 24, 2011 12:55

I've just realised I was wrapping the location tag around the system.web and system.webServer in the wrong area of the web.config.

I've placed it in the correct area now and it works! Thanks David.

Edited, Aug 24, 2011 17:24

Great stuff, glad I could help Mohammed :)

Aug 24, 2011 17:55

Hi, I'm having the same issue right now.

Could anyone please tell me how this should be wrappet into web.config?

I would really appreciate.


Aug 23, 2012 10:28

Well, I fixed it as well.

Thanks anyway.

Aug 23, 2012 10:51
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.