Getting Http 403.14 error - c#

I have a MVC project and trying to host my web site using IIS 7.0 on my local desktop. My desktop has Vista x64 bit machine.
I'm getting 403.14 error. I have already tried the Microsoft suggestion, but that doesn't help me.
Does anyone know any other solution?

You may not have the default document specified properly in IIS. But without details, I can't tell you much more than that.

I just had this problem and tried several possible solutions, but none of the worked. It turns out that I had inadvertently created a directory structure that had the same name as my controller and activity.
For example, I had a URL like http://localhost:55501/Product/Preview/2 and there was also a Directory like ~/Product/Preview/2. I would have found it much faster, but I was certain I didn't have a directory named that way.....
So, double check that you don't really have a directory that is named with the same path as the URL.

Related

Issue in routing in existing ASP.NET application

I have a problem with routing in an existing ASP.NET application for work. I have the code for the application and i can build and run it. When i run it I see the home page, but all links and images have invalid URL's. For each URL the same problem occurs.
For example an image on the home page has this src:
src="/appName/Images/img.jpg".
but the image is actually at "/Images/img.jpg". Notice the missing '/appName', this is the problem with every link / image.
The root folder of the application is in the folder '/appName', but the URL's/images seem to think it is one folder above that.
Now I could change every URL and take out the '/appName', but I feel like it should be possible to run the website correctly without changing the code. Maybe i should change something about the environment or IIS express.
HttpContext.Current.Server.MapPath("~") returns the path to the /appName folder. So the img src and a href start looking in /appName/appName which doesn't exist.
I have searched online, but cannot find anything.
I've already tried changing the root URL in applicationhost.config, but this resulted in IIS not finding an application in that folder.
I know the website works in the production environment, though i currently have no access to the production environment. But i do think it is an environmental setting (maybe in IIS).
So does anybody have an idea how to change it so the links think the root URL is one folder above the actual root folder in IIS?

Trying to host ASP.NET MVC website on IIS

I have server, with static IP. All I want is to make my ASP.NET MVC 5 webstite work on this server. I have follow many tutorials. But none of them does not give me expected result. I was facing many troubles, IIS could not read config file, file browsering disable etc, etc. I was fixing all of them. In one moment I have got this instead of Login page which should be default(I changed it in config and IIS default files). When I try to open my Views I have this.
I was googling this problem. But none of solutions from internet does not help. Pls let me know if you need more information. Im stacked, pls help.
problem 1: Directory browsing: needs to be turned off.
problem 2: Default document: specify the actual filename. Doublecheck that it's in there and marked at top. I for example have a website which has a different named file, which is not in the default IIS settings, and I have to re-add it every time I publish.

Acces Denied - Generating a directory in Microsoft Server with Silverlight

I have searched the internet and cannot seem to find the answer to my question. I have also searched thoroughly through stackoverflow, which might help me to pose a better question.
I have made an application with webservices in C#, which is running in Silverlight.
My problem is that the application has to create a directory with a relative path. Locally it works, but when I upload it to Microsoft Server it does not create a directory.
It says the following:
File operation not permitted. Acces to path: 'c:/inetpub/wwwroot/...' is denied.
I use this line of code for the creation:
Directory.CreateDirectory(System.Web.HttpContext.Current.Server.MapPath("TEMP/");
On the map where the application is running, I have granted all rights to public and IIS user. But it still gives the same error. Besides this, I have also wrote a small piece of independent code in .Net to create a directory. This was to test the access and that works.
So I don't really know where to look.
#Update - 22/05/2014 - 14:29
I have literally deleted all code and just kept a create directory function with one button and one event handler:
Directory.CreateDirectory("path");
I have noticed that relative path's do not work in Silverlight here. (He seems to think the path the browser(i.e. Chrome) as being the parent and not the application's path).
Some other findings are, that if I put in the absolute path. Locally it works, but when i upload it to the server it again says acces denied...
Any tips are very welcome!
I have found the solution to the problem!
The following was going wrong:
My silverlight application consists of two parts. A Web-service and a Client;
The Web-service executes as being the user: IUSR, which had the full rights on the server.
The Client executes as being the user: DefaultAppPool.
The problem with this, is that the DefaultAppPool user can not be given rights as easily. If you try to give rights the default way, in the map settings, the DefaultAppPool user cannot be found.
The correct way to give full rights to DefaultAppPool, is to go to the command console and type:
icacls c:\"Path to the map" /grant “IIS APPPOOL\DefaultAppPool”:(F)
For more detailed information about this, check the following link:
http://eufuckingreka.wordpress.com/2013/02/12/granting-defaultapppool-permissions-to-a-direction-on-windows-server-2008/

Unable To Access File In IIS 6 Virtual Folder From Web Application

I have a website sitting in a virtual directory in IIS 6.0. Within this virtual diretory there is also a P12 certification that I need to use for accessing an external web service. When I attempt to access this file through the site, I get a "file not found" error.
I have verified that the file is there and have mirrored my local dev enviromnent to match production and all works fine there.
I'm pretty confident that this is a permissions issue.
Can anyone point me in the right direction?
Thanks!
By default, IIS 6 will only serve specific types of files (based on extension) to requesting clients. If you're P12 certification (I'm not sure what that is) file is not one of those, a 404 is exactly what you should receive.
In your IIS admin console, you can modify the list of file types which are processed and/or served.
It sounds like it's possible you're attempting to access this file programmatically, in which case you'll need to provide a bit more information - show us the code that is attempting to access the file, and maybe the exception as well
EDIT:
Based on your comments about the location of the file, you could try doing something along the lines of this:
File.Exists(Server.MapPath("/") + "DLWSCert.p12")
I found that the message of the exception is misleading. The message says was File Not Found but the message was contained within a System.CryptogrphyException. Ultimately, the problem was permissions on the app pool account. Once those were set properly, it worked fine.

Downloading from website error - Could not find a part of the path

I am trying to create a quick fix for a problem I am having. All I need to do is download a file from my website to a local computer.
I have a website using ASP.NET and C# and I have added the code below to a button click to download a file:
WebClient webClient = new WebClient();
webClient.DownloadFile("http://www.mysite.com/myfile.ext", #"C:\test\myfile.ext");
which produces the error in the title:
Could not find a part of the path 'C:\test\myfile.ext'.
The directory does exist on my computer.
From what I have read this appears to be a permissions issue on the local computer. I have added full permissions on that directory for the NETWORK SERVICE user as I am running Windows 7. I also have a user that is running XP so I believe the user there would be ASPNET.
Needless to say none of this has worked and allowed me to download the file. I'm a little out of my element here so I'm not sure what to do. It could be that I'm on the right track and just missed something obvious, or maybe I'm way off base.
Anyone have some guidance for me?
EDIT
The more I think about this, I can't help but think there's a better way to do this.
I've downloaded from websites before without ever needing to deal with permissions, so what would be a better simple approach? What am I missing here?
ANSWER
Thanks, I found exactly what I needed from Hari's responses below.
The user running the application pool used by your website needs to be given permissions to read that file. So, goto IIS > app pools > find the one for your website > the one that's under identity.
Check the application pool identity type to make sure you are granting permission to the correct user, see this website for more details.

Categories