The resource cannot be found in asp.net web form - c#

I created an ASP.NET webforms application and it runs successfully, but after few when I open my project and run in VS then my project shows the error shown here. I searched about the error but I can't get exact solution.
The main problem not in path or link the main issues on my system because when I run application, I get the same issue, but then I off my antivirus, then it's working.
But now if I off the antiviruses then I will not working it's showing me the same problem.
Error Message
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Login.aspx
Version information:
Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4494.0

Related

Response.Redirect() Works in Visual Studio but not IIS

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");

Could not load type 'PrintMan.MvcApplication'

I am making my very first asp.net project live and running into what I assume is configuration options. Note that there are similiar threads on StackOverflow regarding this but I have already gone through those answers but no success.
The project is working perfectly in my dev environment but on the production server it fails to work. I have restarted IIS, I have currently only this site in the config and the namespace is correct.
Having limited experience in this I am hoping someone can explain what the underlying issue is :)
Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'PrintMan.MvcApplication'.
Source Error:
Line 1: <%# Application Codebehind="Global.asax.cs" Inherits="PrintMan.MvcApplication" Language="C#" %>
Source File: /global.asax Line: 1
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34274

How to build a solution or run an asp.net project from a folder containing .aspx.cs, .cs, .config and .css files

NET and C#. I have a fair understanding of executing a web app built on wamp/lamp framework. However here I have the following files for the project (mentioned below). I am unable to figure out how to get the web app running on my local machine.
With wamp/lamp, all we need to do is put the .php file in www root folder and it runs. However here I am clueless on how to proceed.
I have got the IIS running on my local.
The below files are located in this path:
C:\inetpub\wwwroot\Project\code
aboutus.aspx
aboutus.aspx.cs
Accountpage.aspx
Accountpage.aspx.cs
addphotos.aspx
addphotos.aspx.cs
chatid.aspx
chatid.aspx.cs
chatroom.aspx
chatroom.aspx.cs
composemail.aspx
composemail.aspx.cs
confirm.aspx
confirm.aspx.cs
confirmok.aspx
confirmok.aspx.cs
createaccount.aspx
createaccount.aspx.cs
Default2.aspx
Default2.aspx.cs
eo_web.ashx
Faq.aspx
Faq.aspx.cs
file manager.aspx
file manager.aspx.cs
homepage.aspx
homepage.aspx.cs
inbox.aspx
inbox.aspx.cs
login.aspx
login.aspx.cs
registration.aspx
registration.aspx.cs
send sms.aspx
send sms.aspx.cs
StyleSheet.css
uploadfile.aspx
uploadfile.aspx.cs
useraccount.aspx
useraccount.aspx.cs
video.aspx
video.aspx.cs
web.config
But when I point my browser to
http://localhost/Project/code
I get this error:
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Detailed Error Information:
Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x800700b7
Config Error There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined
Config File \?\C:\inetpub\wwwroot\Project\Code\web.config
Requested URL http://localhost:80/Project/Code
Physical Path C:\inetpub\wwwroot\Project\Code
Logon Method Not yet determined
Logon User Not yet determined
Config Source:
13:
14:
15:
More Information:
This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.
Please help me get started with this.

Server Error in Application "My web site"

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

Error: Unable to generate a temporary class (result=1) ... When Invoking Methods on a Web Service

Error: Unable to generate a temporary class (result=1) ... When Invoking Methods on a Web Service. I am using VS 2008 C# ASP.NET 3.5. I am invoking a remote webservice to my application.
Server Error in '/' Application.
Server was unable to process request. ---> Unable to generate a temporary class (result=1).
error CS2001: Source file 'C:\WINDOWS\TEMP\6sbkwt2d.0.cs' could not be found
error CS2008: No inputs specified
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Unable to generate a temporary class (result=1).
error CS2001: Source file 'C:\WINDOWS\TEMP\6sbkwt2d.0.cs' could not be found
error CS2008: No inputs specified
Source Error:
Line 775: [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CheckLogin", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
Line 776: public System.Data.DataSet CheckLogin(string uname, string pswd) {
Line 777: object[] results = this.Invoke("CheckLogin", new object[] {
Line 778: uname,
Line 779: pswd});
Source File: c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\14127ae4\96323535\App_WebReferences.u9ldrmk1.0.cs Line: 777
First, credit where credit is due. The OP solved this problem and answers it in the comments section of the question. However, I understand that many people come to StackOverflow and will read through the question, and not look at the comments. Therefore, I'm relaying the above answer here. Be sure to up-vote the question if this is useful.
This problem occurs because the account that is associated with your web service's application pool in IIS does not have read/write permission to the C:\Windows\Temp folder. I have no clue why the account needs access to this folder, but it does. From my casual observation it looks like it just writes an empty file with a random name to the Temp folder.
To solve this problem browse to the C:\Windows folder, and right-click on the Temp folder. Select Properties, and on the Security tab add the account associated with your web services application pool. Hit the OK button, go to IIS and recycle your application pool. This should fix your web service request.
It is worth noting that the circumstances around this error can be a bit deceptive. I've ran into this problem a couple times over 5 years. (I've forgotten about it each time.) The reason why it's not so noticeable is because you can publish a web service, successfully browse to the associated asmx page and see the outline of your web service methods. Furthermore, your Visual Studio project can add a reference to the Web Service and Visual Studio will auto-generate all associated classes for the web service in your VS project.
This gives the impression that everything is working properly until you make your first request to execute a method on the web service. The web service will fail when it begins executing code because it wants access to the temp directory.
Further information regarding this bug can be found at the acknowledged bug report at Microsoft.com.
That happens when your web site doesn't work with Application Pool "DefaultAppPool" and you chose its own pool.
In that case you need to add an user with the name of your pool.

Categories

Resources