0

I created an App in VS 2017. It has a SQL Database (Entity Framework connected) and other MVC components. in the local IIS it works without any trouble. Assume the Project is in folder (of local machine) : MVCPrj

I have a website and it has a particular folder, in which there is a Web Forms project and that runs in the site without any trouble as well. Assume the Project is in Folder : BaseFolderInMySite\WebFormsPrj

The following works without any trouble

http://www.mySite/WebFormsPrj/default.aspx

For testing purposes, I need to create a separate folder inside BaseFolderInMySite and I want to place the MVC project inside it.

I created that folder and published the app. I can see the files properly placed in the directory. But that site gives an error page. The old one works.

If I summarize: The Webforms app in BaseFolderInMySite\WebFormsPrj works for http://www.mySite/WebFormsPrj/default.aspx

The MVC app in BaseFolderInMySite\MVCPrj doesn't works for http://www.mySite/MVCPrj

Here is the error message

enter image description here

Since it is saying the web,config file has the issue, I checked it. It is the line with

<authentication mode="None" />

I googled, checked thoroughly in SO and tried to get it fixed by various means and failed. I removed the <system.web> thinking that it conflicts with the main app, which is running. Changed the mode to Windows, Forms, ... no luck.

My question is how do I fix this.

Deepani
  • 3
  • 3
  • Does this answer your question? [web.config allowDefinition=MachineToApplication error](https://stackoverflow.com/questions/16307112/web-config-allowdefinition-machinetoapplication-error) – Gusman Jun 27 '20 at 22:04
  • @Gusman, That is for a web forms project. my web forms is working ok. my problem is with the MVC Project in the same base directory as the web forms – Deepani Jun 27 '20 at 22:07
  • Your problem is that you have a `web.config` somewhere that it's not the root nor a virtual directory and it includes directives that can only be placed on the root `web.config`. That's what that answer explains. – Gusman Jun 27 '20 at 22:10
  • Did you try just the MVC project only? – Srinika Pinnaduwage Jun 27 '20 at 22:11
  • @Gusman, I have web.config files already in base folder and inside the webforms project folder. But this project is separate. – Deepani Jun 27 '20 at 22:22
  • Is separate but you haven't placed it in a virtual directory, so some directives can't be specified in it's web.config. – Gusman Jun 27 '20 at 22:24
  • @SrinikaPinnaduwage, No, it is quite a bit tedious and risky. the one in web forms is working. I don't want to disrupt it – Deepani Jun 27 '20 at 22:24
  • @Gusman, sorry, i'm not getting you. i cannot create any virtual directory in the hosting site. I created a regular folder by log-in using ftp – Deepani Jun 27 '20 at 22:25
  • Then you can't change authentication mode, it's set at application level, in the root web.config. In order to specify a different authentication mode you must create a different application (another site) or a virtual directory. – Gusman Jun 27 '20 at 22:28
  • @Gusman, Is there a way to have both projects with one web.config – Deepani Jun 27 '20 at 23:35
  • @Gusman, I renamed the web.config in the base folder. Still the Web Forms one working, but not the MVC one – Deepani Jun 28 '20 at 20:21

0 Answers0