Runtime Error when accessing virtual directory on remote server IIS7 - asp.net

I'm having issues with a virtual directory mapped to a folder on a remote server. Basically what I want to do is to fetch an xml file located on the remote server through a request to a web server, e.g http://example.com/Archive/file.xml, where "Archive" is a virtual directory pointing to a folder on the remote server. I'm not using application/pass-through authentication.
When the virtual directory points to a local folder on the web server machine everything works fine.
I have another site running on the same server, difference being that this other site (where the virtual directory mapping to the remote server works fine) is a Web Forms site and the one I'm having trouble with is a .NET MVC site. My first idea was that there's something fishy with routes configured for the MVC site, but in that case it wouldn't work when the archive is mapped to a local folder (I suppose).
So, the question, what am I missing? It seems to be something in the IIS configuration...
Web server setup: Windows Server 2008 Standard, IIS7, Site running on .NET MVC
File server setup: Windows Server 2008 Standard
(both servers are on the same subnet and can reach each other on 192.168.0.X)
Edit: After adding a web.config to the folder on the remote server, I get this error instead. Permissions are, from what I can tell, correctly configured:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: An error occurred loading a configuration file: Failed to start monitoring changes to '\\fileserver\c$\inetpub\wwwroot\Archive\fileDir' because access is denied.
Source Error:
[No relevant source lines]
The web.config in fileDir looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
</staticContent>
</system.webServer>
Looking in the Windows Event Viewer I find the following application error:
Failed to start monitoring changes to '\\fileserver\c$\inetpub\wwwroot\Archive\fileDir' because access is denied.

Just an update as I found this old question and remember how it was solved:
The problem was with our internal DNS server which has been a pain ever since it was introduced. Accessing the remote directory on its IP instead solved the problem.
Cheers!

Related

Server Error in '/admin' Application....An application error occurred on the server

I have 2 projects in my solution (ASP.NET MVC 5), one for the client and one for the admin. Both projects are running fine locally. But when I publish the admin project (which is located in the path: root/admin in my hosting) I'm getting the next error:
An application error occurred on the server. The current custom error
settings for this application prevent the details of the application
error from being viewed remotely (for security reasons). It could,
however, be viewed by browsers running on the local server machine.
Something to know, I have added:
<system.web>
<customErrors mode="Off"/>
</system.web>
But i don't see any specific error and also I have configured the virtual directory root/admin as an application in IIS.
I know this is a common error but I don't see any solution like this one: Server Error in '/' Application. ASP.NET
The entry "Data.Models.ApplicationDbContext" has already been added.
That along with the Source File being the web.config, I'd look to see if that ApplicationDbContext is in the web.config twice and causing an issue in loading the application.
In the error message above is this reference:
e:\Web\deliver4\admin\web.config line: 18
So, what are around line 18 in that web.config file?
I solved the problem with this https://stackoverflow.com/a/6679286/2958543
<remove name="Data.Models.ApplicationDbContext" />
after my connectionString.

WCF IIS Error 403

I am reading the book WCF 4.0 Multi-tier Services Development and tried implementing a simple Hello World with WCF using IIS.
I have a HelloWorldService project and a HostDevServer project (Startup Project). I should see a directory listening with two files but instead I get the next error message:
HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory.
Most likely causes:
A default document is not configured for the requested URL, and directory browsing is not enabled on the server.
What I have done:
Enabled Directory Browsing in IIS manager
Checked if I had Default Documents, they were present.
Run command: appcmd set config /section:system.webServer/directoryBrowse /enabled:true
In the about screen in IIS it says version 7.5 and in the browser it says "IIS 8.0 Detailed error ...". I don't know if this has something to do with the problem.
I use Visual Studio 2013 for development. Web.config below:
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
Does anyone know how to solve this problem?
I suspect you try to host the WCF as it was hosted with the self-host - under an extensionless uri.
This won't work. WCF services are hosted under *.svc activators. The extension informs IIS that it should find a proper host factory and create the service.
I added the website to the IIS manager and now it is working. I did need to edit permissions to acces the files but now i can acces the page without problems.
Should have read further in the book because they also explain about *.svc activators later.

asp.net website doesn't run on server

I'm getting a runtime error when I try to access my asp.net website on a server. It works fine from my computer when I test it but once I upload it to my host, the runtime error appears.
I get this message:
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
My webhost is godaddy. The server is indeed windows and according to their tech support they have all the frameworks installed and up to date (I'd imagine this anyway from such a large host).
Basically they say it's an error on my end but I have no clue what I'm doing wrong. I made the website with Visual Studio 2010. I'm new to this technology.

error when uploading a aspx website

when i host my website on my local machine on IIS 7 my website runs correctly, but when i upload the website to my hosting space online the error:
<sessionState mode="InProc" cookieless="false" timeout="20"/>
(comes up in red)
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: 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.
comes up. could you guys please help me out?
Notes i use multiple web.config files and no i cannot delete them
Much appreciated
The clue is here: "This error can be caused by a virtual directory not being configured as an application in IIS."
Depending on who your hosting provider is, check that your website is running as a Web Application.
The tag is allowed only at the root level. If you are using multiple web.config's ensure that you haven't copied this tag into any other config file.
Also ensure that your virtual directory root is marked as an application.

Server Error in '/' Application. ASP.NET

Greeting,
I developed a website using ASP.Net 3.5 and C#. It is working good with Visual Stdio 2010.
I uploaded my website to my domain under the public folder.
First time I lunched my website for testing (http://wecoders.com/Habib_cuizine/Gallery.aspx)
I would revive (Server Error in '/' Application.)
Runtime Error Description: An
application error occurred on the
server. The current custom error
settings for this application prevent
the details of the application error
from being viewed remotely (for
security reasons). It could, however,
be viewed by browsers running on the
local server machine.
Details: To enable the details of this
specific error message to be viewable
on remote machines, please create a
tag within a
"web.config" configuration file
located in the root directory of the
current web application. This
tag should then have
its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
>
> <configuration>
> <system.web>
> <customErrors mode="Off"/>
> </system.web> </configuration>
Notes: The current error page you are
seeing can be replaced by a custom
error page by modifying the
"defaultRedirect" attribute of the
application's
configuration tag to point to a custom
error page URL.
> <!-- Web.Config Configuration File -->
>
> <configuration>
> <system.web>
> <customErrors mode="RemoteOnly"
> defaultRedirect="mycustompage.htm"/>
> </system.web> </configuration>
To fix this error I added to the webConfig file inside tag:
> <customErrors mode="Off"/>
After that when I lunch the website I would receive a new error as listed bellow:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: 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.
Source Error:
Line 35: ASP.NET to identify an incoming user.
Line 36: -->
Line 37: <authentication mode="Windows" />
Line 38: <!--
Line 39: The section enables configuration
Source File: \10.0.40.35\wecoders.com\public\habib_cuizine\web.config Line: 37
Please advice how to fix this error and how configure my website which developed using Visual Stdio 2010 to be published in the internet.
Regards,
The key information in this error is this line:
This error can be caused by a virtual
directory not being configured as an
application in IIS.
In IIS, you can have several applications, but they must be configured as an application. Generally, when you create a web project it maps directly to an IIS application.
Check with your hosting service on how to create an IIS application for your web app.
Edit - added
If this is on your server, you can set this up yourself following the instructions in #Frazell Thomas's answer. He beat me to finding that link. To save yourself some reading, you should be able to focus in on the Creating Virtual Directories and Local Web Sites section.
right-click virtual directory (e.g. MyVirtualDirectory)
click convert to application.
Have you configured the virtual directory as an ASP.NET application for the right framework version?
See IIS Setup
Look at these two excerpts:
I uploaded my website to my domain under the public folder.
and
This error can be caused by a virtual directory not being configured as an application in IIS.
It's pretty clear to me that you did exactly what you said you did, and no more, i.e. you transfered the files to the web server, but nothing else. You need to configure that public folder as a virtual directory in IIS as the error is telling you, or it's just not going to work.
Looks like you have <authentication mode="Windows" /> in your web.config file but your hosting provider won't let you use that. Just remove that line.
I got the same problem and my solution was to remove webconfig file from the directory.. then it works..
http://www.velocityreviews.com/forums/t123353-configuration-error.html
If you want to use inetpub/wwwroot/aspnet as your application, remove this
line :
Line 26:
and any other lines which define MachineToApplication beyond application
level
If you want to use d:\inetpub\wwwroot\aspnet\begin\chapter02\ as your
application,
create an IIS Application which points to
d:\inetpub\wwwroot\aspnet\begin\chapter02\
maybe you can refer link above.
For my application, my web.config store in d:\inetpub\wwwroot\aspnet\begin\chapter02\
and when i move the web.config to d:\inetpub\wwwroot\aspnet and the problem is solve.
Please check also does your application have two web.config file.
Looks like this is a very generic message from iis.
in my case we enabled integrated security on web config but forgot to change IIS app pool identity.
Things to check -
go to event viewer on your server and check exact message.
-make sure your app pool and web config using same security(E.g Windows,integrated)
Note: this may not help every time but this might be one of the reason for above error message.
I have the same issue, my application was running on amazon vps, lately i found that bin folder had multiple copies of dll's ...
After removing those copies of dlls like entityframework(copy1).dll, errors were gone....
May be some one will get help...cheers
Removing the web.config-file from the IIS Directory Folder solves the problem.
Try removing the contents of the <compilers> tag in the web.config file. Depending on who you're hosting with, some don't allow the compiler in production.
Your application is trying to compile when it is called and their servers won't allow it.
This wont necessarily fix the problem...but it will tell you what the real problem is. Its currently trying to use a custom error page that doesn't exist.
If you add this line to Web.config (under system.web tag) it should give you the real error.
<system.web>
<!-- added line -->
<customErrors mode="Off"/>
<!-- added line -->
</system.web>
If your project is linq with Sql Database.
Then Simply Check your System Services and Start sql Server Agent Service.
Now your problem is solved.
Just check connectivity between SQL And your App (if you used SQL)

Resources