Issues occured when changing a Project to a Website in Asp.net - asp.net

After changing a Project to Website, i got an error while running the application.The error is as follows:-
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 ISS.
How can i solve this problem?ISS is installed in my system.Then what could be the reason for this?
Please help...

Sounds like your virtual directory isn't set to run as an application.
Go into IIS, find the virtual directory that contains your project, go into properties for that folder and in the virtual directory tab you'll see 'Application Settings' near the bottom. Click the 'Create' button down here to set the website up as an application.

In the IIS Manager snap-in, go to your web site property page, then select create application.

Related

Errors after add Virtual Directory in IIS

My web service on IIS can work well w/o a virtual directory (called by http://localhost). However, I want to call it like http://localhost/virtualpath.
So I added a virtual directory in IIS, but when I explorer website, it gives me the following error:
What does this mean and how to solve it? (I'm using IIS 8.5)
It means exactly what the error says - you've tried to set a section in web config beyond application level. I'm assuming that you added the virtual directory under a pre existing website in IIS? What you want is to add a physical directory under the website with your app in and then simply right click and convert that folder to an application.

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

Getting this error on an intranet application we have running in our development environment, and I'm not sure where to go/look for a solution. The application used to work fine, however it is run on a shared server with another team of developers and we're having trouble tracking down the error (no updates were made to the application by my team, it suddenly stopped working).
We're running Windows Server 2003 and IIS 6.0. If I open the solution on my machine, however, I receive an error in Visual Studio solution points to this line in the web.config, however I believe this is a relatively standard setting and we actually have this running in another environment (same server/IIS set up)
<authentication mode="Windows" />
The error reads
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.
I've also changed the <system.web> section of the web.config on the server to include <customErrors mode="Off"/>, however oddly enough when I navigate to the site I am still getting the custom error page...
I'm relatively new to IIS and never worked with Windows Server 2003. Can someone help point me in the right direction either to get the actual error so display in the browser or how to fix the error given to me by Visual Studio?
Bring up project properties page in Visual Studio. Right-click on project node in Solution Explorer and click properties. Look for the Web tab and click the button to create a virtual directory.
In some cases this could be caused by creating another sub-folder in your project and you added another Web.config file which has the same filename as the other Web.config file in the root folder.
To resolve this error, rename your newly added Web.config file to another name.
In my case inside my web directory, I had an other web directory along with its own web.config file. When I removed that sub directory that was a complete website in its own my problem is fixed now.
Just had this issue ... turned out to be a result of allowing debug information to be produced when publishing the Web App.
Publish Web App - Settings - File Publish Options - Precompile during publishing (true) - Configure - Emit debug information. (Should actually read "Omit debug information")
Delete Debug subdirectory of project and republish
This can also happen when you create a publish folderprofile if you take the default location, which is app.publish folder under your project folder. VS then gets confused and thinks there's another web.config it has to reconcile when building. Why does microsoft allow you to shoot yourself in the foot like this? Moving the Publish FolderProfile to another location stops the error from occuring.
any how web.config should be in the root directory most probably it happens when you don't have the solution file for your project. Close VS open it once again and choose the direct folder. Note web.config file should be in root directory or if you want to in sub directory then copy the webconfig file and create a new config file in the root. Caution:if you have mentioned any path in config file that will be lost
I had this problem. I think I caused it to start happening by modifying some settings in the publish profile. Undoing those settings fixed my issue. Here's what I did:
Right click on the project and go to publish
In the publish tab, in the configuration row, click "configure"
go to the settings tab
expand File Publish Options
I unchecked all of the options that were there. (checking some of these is what i believe caused my problem in the first place)
I deleted the bin and obj folders in my publish directory.
I have VS2017

Asp.net "allowDefinition=MachineToApplication" error

I have edited the relevant .cs files in my web service. But after editing I end up with 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." Can you please let me know what should be the problem? Because there are no Warnings, no issues, it's just one error. Please help me. Thank you in advance.
This is normally caused when you have a web aapp/virtual directory containing a Web.config, then you add another Web.config in a directory underneath it. The lower directory needs to be configured as a Virtual Directory in IIS.
The error is mentioned in your message. Your folder containing this website is not configured as an application in IIS. I suggest you to check whether or not your folder is a marked as a virtual directory or an application in your IIS.
To configure your sub directory as an application:
Goto IIS-
In your virtual directory where you have this folder, right click on
it and goto properties-
You ill find create option-
Click on it.
Now your folder is an application and you should get rid of the error
Update: To create a virtual directory-
1.Open IIs
2.Double Click on websites
3.Right Click Default Web site
4.New-Virtual Directory-Next- Give some name for alias-Now select your folder containing website-Next-Next-Finish.
Now run your website.

ASP.NET What causes: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application...?

I have an ASP.NET web site. I keep getting the error below in VS 2008. The site works fine from a browser. I have made every folder using IIS manager an ASP.NET app. Why does it keep complaining? The site's folder is below a parent folder.
I am not familiar with web site apps instead of web application app. Where are the options to use IIS or the internal web server like WAP has?
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
I dealed a lot with this error when having more than one web.config in the same virtual web directory / website. It may happen if you make a temporary backup of your website for example. Could you verify it?
This error can occur when you are you redefining stuff in the web.config of your virtual directory that you cannot override. Such as authentication or sessionstate. Try deleting all web.configs in your virtual directories to see if that solves the problem.
You likely have a virtual directory set up as a real site, having a bin directory, aspnet_client and web.config.
Either remove those and run it as a relative path, localhost\subdir\default.aspx, or create a new website in IIS to point directly at it.
My workaround was to move each folder into its own folder under wwwroot.
I resolved this issue by doing the following,
Select your project in Visual Studio and click 'Show all files' under Solution Explorer.
Delete the 'obj' folder and recompile.

MSBuild error while compiling ASP.NET website

I get the following error when I try to compile an asp.net site using a custom build script.
error ASPCONFIG: 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.
Although the description is in detail I do not understand what it means exactly. I have not configured IIS to host this website and I don't think I will be able to as I am running Vista Home Basic version. So the website cannot be built using custom scripts?Please reply as I want to test this feature.
I had this SAME EXACT problem and finally discovered a rogue Web.config was placed in my obj folder ... do yourself a favor and do a search in all the sub-directories for a web.config file. I deleted it and all was back to normal.
The rogue web.config file in the obj folder is most likely to be caused when you do a Publish Web Site. So just clean it up after you've done the publish.
if this happens after the virtual-directory is already created do the following:
right-click on web.config
properties
Build Action: Content
Copy to Output directory: Do not copy
if transformed (apply to all configurations)
properties
Build Action: None
Copy to Output directory: Do not copy
It is likely that your web.config file is placed in a directory that is not the root of the application. On most versions of IIS, you can convert any folder on your web site to an application root:
Open IIS and navigate to the appropriate folder
Right-click on the folder, select properties
Under Application Settings, and beside Application name, click Create
Apply and close
If this does not fix your problem, there may be another configuration error, either with IIS or your application.
In IIS, go to the folder that the app runs under, right click it, go to properties.
On the Directory tab, look for "Application settings". Click the create button.

Resources