I have a Published ASP .NET MVC web project running in IIS within a VMWare Virtual Machine(Windows 7). I am able to log in to the VM and navigate across the application from within the VM itself, but all content files(JS, CSS) are returning a 404 error.
i.e : 'http://localhost/WebProject/Home/Index' loads fine, but, 'http://localhost/WebProject/Scripts/Home/IndexScript.js' within that page throws a 404 error.
Any ideas?
If you can access IIS on your VMWare it means that your IIS works fine and VMWare too but there some settings which restrict access to some urls or url is wrong.
Are you sure that you have file at path /Scripts/Home/IndexScript.js'
If yes then check
IIS not serving static content (css/js/images, etc) 404
IIS7 returns 404 on some static files, not others
Related
We have an app that updates a gitlab project and pushes/commits to master. When I run locally, the program runs fine. When I run on the application hosted server (not the gitlab server), I get a 404 "Project not found".
It's not the private access token, we just made a new one
I can sign in to gitlab on our app hosted server and find the project
I verified the account can push straight to master
There is no xdt transformation on the config files
I logged into the account on the app hosted server and hit the project via the same api url.
Here is the codified url:
RestRequest fileExists = new RestRequest(
$#"api/v4/projects/{project.id}/repository/files/{action.file_path.Replace("/", "%2F")}?ref=master&private_token={ConfigurationManager.AppSettings["JiraPrivateKey"]}",
Method.GET);
I'm almost thinking it's some sort of server setting, but I would think that I would get the 404 when I tried the api url in the browser.
After thinking about it, since I use the ConfigurationManager, I had to copy by .exe.config file to the server and not just the exe itself. After dragging the config and the exe over. It worked. :-(
I'm trying to upload a basic web application from visual studio on Windows 7 to an IIS environment on Windows Server 2007.
Though launching it from IIS displays the Login page, trying to navigate past it to the main menu returns this error:
Server Error in Application "PARKING/PARKING ASSIGNMENTS WEB"Internet Information Services 7.0
Error Summary
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable. Detailed Error Information
Module IIS Web Core
Notification MapRequestHandler
Handler StaticFile
Error Code 0x80070002
Requested URL http://localhost:81/Parking Assignments Web/Home
Physical Path C:\ParkingAssignmentsWeb\Home
Logon Method Anonymous
Logon User Anonymous
Most likely causes:
•The directory or file specified does not exist on the Web server.
•The URL contains a typographical error.
•A custom filter or module, such as URLScan, restricts access to the file.
Things you can try:
•Create the content on the Web server.
•Review the browser URL.
•Create a tracing rule to track failed requests for this HTTP status code and see which module is calling SetStatus. For more information about creating a tracing rule for failed requests, click here.
Links and More InformationThis error means that the file or directory does not exist on the server. Create the file or directory and try the request again.
View more information »
This is the code I used for navigation:
Response.Redirect("Home.aspx");
Why would this navigation work on Visual Studio but not on IIS?
UPDATE: I tried the variations of the Redirect command you guys showed me but all of them gave a 404 error, which leads me to believe that the problem isn't with the command but with something else. Any idea what?
It treats Home.aspx as a relative path.
Use it like:
Response.Redirect("/Home.aspx");
when you deploy to IIS a different web server is being used. Visual studio uses a web server with limited options and in most cases but not all an application should run without changes when deployed to IIS on windows server.
Things to check
Verify that the folder structure on your workstation looks the same as the folder structure deployed to the server.
check permissions on the folders accessed by IIS on the web server
Response.Redirect("Home.aspx"); assumes that the file is in the same directory as the page that is invoking the transfer
add a more complete path either ("/home.aspx") or ("/folder/home.aspx") where folder is the actual folder name that contains the .aspx file
Please try:
Response.Redirect("~/Parking Assignments Web/Home.aspx");
or
Response.Redirect("~/Parking Assignments Web/Home");
I deployed 2 projects under one domain(1.AngularJS and 2.MVCWebAPI).
IN Parent Root i deployed AngularJS Project and WebAPI Project Deployed Under Child root,Example of My Website Structure on IIS 7.0:
For example,
1)AngularJS Website under C:\Inetpub\myproject\
2) MVCWebAPI under C:\Inetpub\myproject\api
I was converted api folder to application from IIS, So api project run with same domain.
Here Issue Occurred with AngularJS Website, when i try to access site from browser then error occurred like 403: forbidden access denied, after refreshing browser more than one times, it's work properly, but when clear the cache of browser then same issue occurred.
I searched about this error but all of say it's need to give a permission to user to access directory, but i already give it.
System.IO.CreateDirectory or System.IO.File.Create won't work from a web service when navigating to the app remotely. It works locally.
Environment:
- .Net 4.5, Asp.Net, C#
- VS 2012
Remote:
- Windows 08 R2
- IIS 7
- App Pool (.Net 4.0, Integrated)
Process:
The web service is in the project and is used in jQuery .ajax call with url: 'Services.asmx/UploadFile'. The WS method creates the folder chain (if not found) and writes the file.
The file upload works perfectly fine locally in VS.
It also works perfectly when published on a remote server and navigating to it locally on the server (thru RDC) either by localhost/{app} or by http://{ip}/{app}. The folder chain is created and file is written.
However, it does not work when navigating to it normally.
I'm pretty sure it's a user permission issue but I've exhausted all options. I've assigned modify rights on the app folder in wwwroot to "NETWORK SERVICE" and even though I'm sure unnecessarily to "IIS_IUSRS", "IUSR", "LOCAL SERVICE", "NETWORK" and none have helped! I just keep getting status 500 when I navigate to it normally. But it has always worked locally as mentioned above once I gave it "NETWORK SERVICE" modify rights.
Publishing a basic test app with a button and CreateDirectory in code-behind on the same server worked after assigning modify rights to "NETWORK SERVICE" on the app folder in wwwroot.
The create directory code in the web service is:
[WebMethod]
public void UploadFile()
{
string _userId = HttpContext.Current.Request.Form["userId"];
HttpPostedFile _file = HttpContext.Current.Request.Files["Filedata"];
string _uploadsFolder = Server.MapPath(String.Format(ConfigurationManager.AppSettings["FileUploadPath"], _userId, "Temp"));
if (!Directory.Exists(_uploadsFolder)) Directory.CreateDirectory(_uploadsFolder);
FileStream _fileStream = File.Create(Path.Combine(_uploadsFolder, _file.FileName));
_file.InputStream.CopyTo(_fileStream);
_fileStream.Close();
}
FileUploadPath in web.config is
When it works, it works with or without the "~/" in the path. And when it doesn't work, it's the same, with or without, it won't work.
I've bougth an web hosting wervice so I can put my web site on it. But I got this problem
Server Error in Application "my website":
**Detailed Error Information**
Module IIS Web Core
Notification MapRequestHandler
Handler StaticFile
Error Code 0x80070002
Requested URL http://mywebsite.se:80/Index.cshtml?aspxerrorpath=/
Physical Path E:\inetpub\webhosting\industri2\mywebsite.se\www\Index.cshtml
Logon Method Anonymous
Logon User Anonymous
**Most likely causes:**
The directory or file specified does not exist on the Web server.
The URL contains a typographical error.
A custom filter or module, such as URLScan, restricts access to the file.
Earlyer I got this problem CustomErrors mode=“RemoteOnly” but I put it on off now. And this problem comes up: server error in application. I'm using mvc and ms web dev 2010 have a publish and I'm using it. But got this problem.
Here are a few things to check:
Is the hosting provider running the correct version of ASP.Net
Is razor supported
The actual file exists on the path you set, try putting an ordinary HTML file in there to see if you can hit it