Setting up .net project in IIS locally with URL 'application.local' - c#

I am trying to set up a .NET application locally to run with a different alias to 'localhost'. The application has a successful connection to the database and runs correctly when running as localhost.
In some of my projects, I am able to access the application on the browser by writing '.local' after the application name. For example, a project called toysandstuff can be accessed in the web browser with 'toysandstuff.local. instead of having to run it through Visual Studio and localhost.
I have this set up for some of my applications at work but i'm not sure how to configure IIS and Visual Studio to run the project as '.local' instead of using localhost.
Thanks in advance!

Related

MVC Authentication not working in IIS (works in IIS Express)

I have created an MVC project with individual authentication and am using the default template. When I launch the application from within visual studios (IIS express) I am able to view all the public pages, register an account, and login. Everything works great.
However, When I publish the project and host it on a full IIS server (on Windows Server 2016) I can view all the public pages, but registering or trying to sign in yields the following generic error:
I am using the LocalDb for the project and I noticed that the windows Identity on the deployed applicaiotn is "NT AUTHORITY\SYSTEM" while the IIS Express application's is USER-DESKTOP\User. Is this error being caused by a permissions issue and if so how do you fix this?
Also, is it bad to use localDB for a deployed project? There will only be two users using the application and they are both trusted.
It is totally not good idea to use localDB for a deployed project,
it is meant for developer testing only.
when you start debugging in vs the localDB is started.
its better if you use SQL Express
https://go.microsoft.com/fwlink/?linkid=866658
Try to set your site application pool identity to the local system by following the below steps:
1)Open iis manager
2)Go to the application pool and select your application pool name.
3)Click on the advance setting.
4)There is a "Process Model" option, under which there is an "Identity" option. This is by default the application pool identity. Change it to Local System, and you're done.
Set “Load User Profile” to True.

Why ASP.NET Project Gives HTTP Error 500 When Launched Through IIS 7

I'm writing an ASP.NET Web Forms project in Visual Studio 2013, but am having trouble moving it to my computer's IIS 7. Although the project launches successfully from Visual Studio and works properly, launching the version I put on IIS gives an HTTP 500 error: "localhost is currently unable to handle this request."
Here is my process:
Use the File System method of Visual Studio's Publish tool to publish the project to a folder on my computer.
Access IIS' Default Web Site, and set the Physical Path to the folder I published the application to.
If the project works from Visual Studio, why wouldn't it work in IIS?
I had a double entry for in my web.config, and it was causing the same issue: 500 error with no other clue.
The problem was I was submitting a Web Form Application instead of a regular Web Site. The former has additional files in it that makes it not work properly in IIS (at least, I've never been able to make it work).
Thankfully, making a blank Web Site in Visual Studio and copying the web pages over from the Web Forms application was a simple matter, and I got it working easily.
I had an entry made in the web.config
which caused this error...remove the line fixed this issue. so probably any error in web.config makes the browser to not load the server and hence the issue

Deploying website to Customer localhost

I developed Store Management software but as web application (asp.net-MVC),I want to publish it to a customer localhost to run like desktop application ,I published it to my PC Localhost and it work correctly , What is i need to make it run on customer Localhost correctly? , do i need IIS and SQLServer and Visual Studio or i don't need Visual Studio , and is there A tool to run database on customer PC more simple than SQLSever
You can take the WebDeploy package and deploy it to any IIS instance which includes IIS express.
https://www.microsoft.com/web/gallery/install.aspx?appid=IISExpress
However, I would suggest looking at ASP.NET Core instead, as it does not require IIS and can run self-hosted. Its not publicly released yet but getting closer every day.
https://blogs.msdn.microsoft.com/webdev/2016/02/01/an-update-on-asp-net-core-and-net-core/
Regarding the database, I would suggest SQLite which is a file-based SQL database.

ASP.NET ressource file in iis

I have a c# asp.net application with the framework v4.0 . In my application, I am using some resx file. When I locally run my application, all is normal (the localization work pretty well). Now I am trying to setup my application on iis 8 (The server with iis is a 2012 r2). The problem is all the control that are using the resx file to get the text property are empty.
So, given that all is working good locally and not on iis, is that iis need some special configuration to use the resx file properly ?
When you say you run it locally, are you running it through visual studio or are you running it off a local version of IIS? There are differences between configuration of IIS in visual studio and the "real" IIS, so you might want to start there. Also, are there any errors or warning being generated in the event viewer?

Visual Studio 2010 - Application not starting up through asp.NET Development Server but works on the Production Server

I am building a .NET 4.0 Web Forms application in C#. After working for around 4-5 months on this application, the other day when I went to 'Start' the application from Visual Studio 2010 and the application does not want to start. When trying to connect using telnet on the local host and that port, it connects, and after a while I get an error '400 - Bad Request'.
The funny thing is that when I Publish the application on another IIS server, it works fine, it seems like the problem is from the asp.NET Development Server. While I know that I can set-up a local IIS, I would prefer not to avoid doing this in order to avoid certain problems which might be related to having a different configuration of the local IIS from production.
I have checked the hosts file, re-installed visual studio and confirmed that the application works when published. I have also checked that the port is not being used by another process.
What else should I check?
If the application will not start, then the odds of you being able to connect to it via telnet on a port are 0. (It's not running.)
I am assuming the application can compile if you can publish it. Have you tried running the application without debugging? CTRL + F5

Categories