Giving 404 error in web site ? Asp.net? - asp.net

In web application, i created a site and place the code in my domain [using filezilla i upload the my pages in my domain ]. i place my folder which contain the code in domain like
BusinessEntity Folder, BusinessLayer Folder, DataAccess Layer and my code Folder. my web.config is my code folder. but when i type my url it is giving 404 error. Can you help me to solve this problem. Thank you.

404 - Not Found error. Some resource can't be obtained. Open Fiddler or any other web debugger and check what request return 404 error. After that check existing a resource corresponding to Url

Please check all these things are done properly
Publish the project from your local machine (using visual studio)
Upload the published project to the server.
Create a virtual directory in iis (in the server)
Map the virtual directory to the project folder (means select the physical directory as the project folder)
Do the necessary configuration changes (conection strings or appsettings)
Give write permission for the upload folder and error folder (If you use any)
Checkout http://www.advancedinstaller.com/user-guide/tutorial-iis.html

Related

How to restrict the file which is in the folder of my web application project which is built using vb.net and hosted in windows server 2008?

How to restrict the file which is in the folder of my web application project which is built using vb.net?When the url of the web application is used to traverse the file ,it is able to access the file but the folder is restricted..I have the url as "https://firstwebsite.com/js/js.js".When this is run,it displays the script in the file(js.js). When https://firstwebsite.com/js/ is run,it shows the forbidden error.I need to restrict the file also and to show the forbidden error.I have disabled the directory browsing also and tried with many,but couldn't restrict.Server is windows 2008.
I don't have any .php pages but including all the security in web config file but i couldnot redirect the file requested also.I tried to place the script also.Can you please tell me how to redirect the url when https://firstwebsite.com/js/js.js is accessed?
I have a js file say "js.js" in my website.
say my website is "firstwebsite.com" and the js file is in a directory "js"
I want to prevent direct url access to the "js.js" file i.e. if anyone types the url "firstwebsite.com/js/js.js" ,then the js file should not be executed and it should return a error message(403.1 forbidden error or redirect to another page) instead.

404 when trying to access web api

I have an application I'm deploying to azure.
It's a SPA app which uses REST API.
I placed the folder of the app in side the wwwroot folder.
when I try to access the API from my local machine i.e. my localhost:1979/api/auth/login
I can do it but after I place the files in the www folder - I get a 404
when trying to access:
domain.com/api/auth/login
I tried doing it on my machine on my local IIS and got the same error.
I'm sure it's a stupid thing like configuration but I can't figure it out.
Thanks for any help
Solved
Ok.
So I checked the issue on my local IIS and got the same problem.
The thing is, I created a directory inside an existing solution which have the web api + mvc.net and called the directory which contains the html i.e. mydomain.com/dist/index.html directly.
The solution was to send the html file via the controller so when a user comes in to the site, the home controller will send the html file and the ajax call from the JS file which was download from the html will succeed unlike getting the html directly.

Where does IIS look for files

Can anyone explain, please, exactly how .net works. I create a web site in Visual Studio and publish it to a local server to a folder at
D:\WebSites\Project1
I create a web site in IIS and provide the address of the folder containing the files for the web site. When I publish the site, using 'fixed naming and single page assemblies', all the .aspx files go in the folder on the D drive and a dll for each page goes in the bin folder inside that folder.
I would assume that when someone wants to view a page in their browser, IIS retrieves the file(s) required from the folder specified, they get processed and turned into html and sent to the browser.
Recently when someone clicked a button on a page that calls a web service - a file not found error was reported. Apparently
C:\Temp\bx5tn2js.dll
could not be found. The thing is - why did IIS decide to look in C:\Temp for a file?
And, in the error message was a load of references to xml serialization. What is being serialized?
This file looks like the compile files that asp.net generates on compile.
This folder can be setup on web.config on compilation session with the
tempDirectory="C:\Temp"
If you do not have set this option asp.net is use a default folder that is usually inside the asp.net directory, inside the windows folder. But if you have set this, and this folder did not have the correct permissions, then asp.net fails to compile the project, and you can get a message like that.

asp.net web forms -- 404 on publish

I'm having some issues getting my project to publish to a server for work.
we don't have a folder shared to the project directory or a FTP server setup so in order to publish I have to publish it locally, remote into the server, then copy/paste the project files into the desired location.
I have done this plenty of times before with no issues but for some reason it is not working for me now. Every time i go to the site I get a HTTP 404
One weird thing that I noticed is in IIS when i click on 'basic settings' the virtual path is set as /portalDEV/Apps, alias is UA, and physical path is D:\websites\portalDEV\Apps\UA, When i click on 'test settings' i get an error saying invalid application path.
Any ideas? Please let me know if you need anymore information.
On your server IIS you must create virtual path who link physical path of your application.
You set an alias
You set the directory of your application
In the end of treatment your check the framework version section

Remap/Create Virtual Directory for Project folder with IIS

I am getting following message while opening my project in Web Application.
The Web project 'MyProjectName' is currently configured to use the URL
'http://localhost/ProjectName'. The Web server has this URL mapped to
a different folder 'Physicalpath of the project'. Would you like to
remap this URL to point to this Web project's folder?
Any Idea how to disable/enable this message ?
you have two options:
a) either update the url of the project and create a new virtual directory for the project
or
b) update the path of the site that you have already configured by navigating to inetmgr and then updating the path to the new location

Resources