asp.net web forms -- 404 on publish - asp.net

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

Related

How to configure Asp.Net Web Application with IIS

I am using Asp.Net Standard version 4.7 with MVC and attempting to deploy to IIS Express. I am facing several issues in the configuration and cant seem to find straight forward documentation for asp.Net standard. I added a website named localHost aside from Default Website in IIS. I am facing 2 issues.
When I click browse from IIS, it navigates http://localhost/Views/Home/Index.cshtml I get a 404 error.
Server Error in '/' Application. The resource cannot be found
When Debugging From Visual studio 2019 I get
Process with Id of xxxx cant be found
.
Description: HTTP 404.
I am thinking there some port configuration issue but I am unclear on how to configure.
I attached screenshots of my configuration settings.
Please follow Microsoft guideline.
You are trying to access wrong Url. Try below url to access:
http://localhost:8080/Home/Index
Maybe you are misunderstand MVC, you should visit a restful path in mvc instead of cshtml, just like this: http://localhost:8080/Home/Index -> to find /Views/Home/Index.cshtml in you solution.
To host the site .net application you need to publish it and use that publish folder as site folder path in iis.
1)open visual studio, select your project.
2)right-click on your project and choose publish:
3)in publish target select folder and create a new folder in c or another drive where can you access the folder.
4)click on the publish
5)open iis and create a new site
6)choose the folder path and site binding
7)browser your site.
Note:
Assign iis_iusrs and iusr full permission to the site folder. you need to set the physical path credential with your Gmail account.

HTTP Error 500.19 - Internal Server Error 0x80070003 Cannot read configuration file

I'm getting the above error when I publish my application and move it from development to production server. Below are the error details.
Detailed Error Information
Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x80070003
Config Error Cannot read configuration file
Config File \?\C:\inetpub\wwwroot\WorkmenCompTest\web.config
Requested URL http://localhost:80/wictest
Physical Path C:\inetpub\wwwroot\WorkmenCompTest
Logon Method Not yet determined
Logon User Not yet determined
This website used to work previously but recently the published version stopped working due to this error. As far as I can tell, the only change was installing iTextSharp and iTextSharp xmlworker through nuget.
I have tried, without success:
giving modify permission on the site folder to Everyone
checking the web.config file, and using an older version of the web.config file (from when the site worked).
uninstalling iTextSharp and iTextSharp XMLWorker
The project still runs without issue from Visual Studio.
This is solved. The error was caused by the folder name not matching the path for the virtual directory. Oh wow I feel dumb.
Check the applicationhost.config file under - .vs\lpsWeb-UI\config folder of your application root.
Under sites section of the config file check what the physical path points to.
If you modify those you should be able to fix the issue.
This is because of different physical path in the IIS.To change the physical path of application content
You can perform this procedure by using the user interface (UI), by running Appcmd.exe commands in a command-line window, by editing configuration files directly, or by writing WMI scripts.
User Interface
To use the UI
Open IIS Manager. For information about opening IIS Manager, see Open IIS Manager (IIS 7).
In the Connections pane, expand the Sites node and click to select the site in which your application runs.
In the Actions pane, click View Applications.
On the Applications feature page, select an application from the list and then click Basic Settings in the Actions pane.
In the Physical path box, change the path of the application content.
Click OK.
DefaultAppPool application pool runs under the Network Service account. This account is local to the computer and this account does not exist on another computer. Make sure that you configure the DefaultAppPool application pool to use an account that is a domain user. Then, you can use the same account on the WorkmenComp file server. Alternatively, you can create a workgroup account on the WorkmenComp file server.
I am getting this HTTP Error 500.19 error when I am giving physical path as Z:\App_Live in IIS
Instead of using z:\ ,
I used network path \\server\share\live_folder in the IIS physical path – something like this \\server\share\wwwroot\inetpub\wwwroot
Also you may need to specify username/password in "connect as".

Deploying WCF webservice to IIS

I'm trying to deploy a wcf web service to IIS 7.5. Is there anything special I need to do in order to make this work. I keep getting 404 error when I try and run the web service. I can't seem to pull up the wsdl file either.
These are the steps I've taken
Right-clicked on web service project and published to local folder
Copied contents of publish to IIS server
Setup a new website that points to folder with webservice files
set binding to match web.config binding (port #)
Is there anything I missed or overlooked. Shouldn't I be able to run that web service from IIS and load up the wsdl file directly on the server. When I test in visual studio, it handles the loading of that host program.
Apparently you have to load the .svc file path which I was not doing.
Just to expand on this a little, since this question got me started but there were a couple of extra steps I had to take:
In VS2012 right click on the web service project and select Publish
Publish to file system by selecting a directory to publish to
Copy the folder contents into a folder on the server
In IIS create a new website, its physical path being where you just copied the published contents to.
Set its app pool appropriately (probably .NET 4.0)
The binding port should be the same as in the web.config as should the name. So if you've been working locally and your web.config reads "http://localhost:12345/MyService" then hostname is "localhost" and the port is 12345
You can then browse to the webservice by right clicking on the website in IIS -> Manage Website -> Browse. Click on your service name.

Giving 404 error in web site ? 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

The requested page cannot be accessed because the related configuration data for the page is invalid

I am getting this error when I try to run an ASP.NET application without a web.config file.
The requested page cannot be accessed because the related configuration data for the page is invalid
as I read, we can run .NET applications without web config files, but when I tried it is giving me the error. I am using iis 7 on windows 7 machine.
When I create the application virtual directory inside inetpub/wwwroot it works fine. Why doesn't the other directory location?
One reason could be the version of .NET framework (on IIS or application pool level) is different from the application one.
Another reason could be if there are modules used in your web.config which the current configuration of IIS doesn't recognize. E.g. URL rewrite or other optional modules, which you have to explicitly enable before using.
This can be a reason:
If there is no Web.config file in the
UNC directory, IIS 7.0 uses the rules
that are defined for the parent
directory. For the Web content to be
served in this scenario, the
worker-process identity must have
access to the whole content directory.
Otherwise, the Web request is
rejected.
Details here.
You need to set permission for your Website folder or copy them to wwwroot folder.
If you choose to set permission, there are two ways:
Right click on Your Website folder, or
Right click to Your Website in IIS
Then select Edit permission and Add a permission (IUSR - default iis user)

Resources