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.
Related
When I create a new project in Visual Studio using the "ASP Net Core Web Application" template, and press F5 (or click the "IIS Express" debug button), what exactly is happening in the background in terms of web servers?
Does it start an IIS webserver as reverse proxy with a kestrel application server which serves my app (I guess so)?
Can I / How can I run the app without IIS (only using Kestrel)?
Why can't I access my data when I use localhost:5000 (default Kestrel port) instead of localhost:63152 (IIS port)? Shouldn't I be able to access Kestrel directly, even if IIS serves as a proxy?
When I dockerize the app with the default container mcr.microsoft.com/dotnet/core/sdk:3.1 and run it, does this also start an IIS + Kestrel inside the container?
The IIS express will run like you say as a proxy in front of the kestrel process. In earlier versions of .Net IIS would also run the application but now that is handled by kestrel.
In your project you will have (else you can create it) a folder called Properties with a file called launchSettings.json where you can specify profiles for how you want to run your project. In most cases this will be created when you create a new project in VS. Here you can add or modify profiles.
To run your project without IIS express your profile should have "commandName": "Project". You can then choose what profile to run using the interface of VS.
Im not entirely sure why you cant access this.
That depends on your docker file but if you use the standard file it will not use IIS.
My problem is the following, I have a pretty huge project where I've deployed The Identity Scaffolding, so it has scaffolded in The Areas map. When I run this project in IIS Express on Visual Studio 2016, everything works fine, but when I published it and deploy it on IIS 10 on my local pc or on an remote server with Windows 2016 and IIS 10 installed on it, he refers everytime to a default template of inlogpage.
How it looks on IIS Express and how it should look.
This how it looks like.
I deploy it in the local IIS Express of Visual Studio but it doesn't in the normal IIS. IIS Express
Scaffolded Identity
Update project is finally running had something to do with the roles on sql server, but still it doesn't explain why he isn't taking my changed my login page
Right page
Default page
Those seem to be different projects, see the year and the project name in the footers. To deploy to IIS, consider using the Web Deploy method instead the File system method. See Deploy the app for further information.
Make sure that your site is using the same folder by click on the explore on the site.
do not forget to refresh the site after publishing from the visual studio.
I have created an MVC 5 website using Visual Studio 2015 on a Windows Server 2016 Machine.
I build and run the application from VS and it works great.
I published it locally, pointed IIS to the root folder.
The Application Pool is set to .Net CLR Version v4.0.30319.
When I try to access the page on the web, I get a generic error
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
There is nothing in the IIS logs.
Not sure how to get this error so I can see it...or if it is a more basic issue. Any ideas on the best way to proceed?
To configure within Microsoft Server 2016, do the following:
Make sure you've installed the feature set for Web Server & Hosting are installed.
If those are installed, create a directory such as: "C:\Program Files\Sample"
Publish your application to the directory
Open Internet Information System
Disable Default Site
Create a New Site
Create a Site Name "Sample" (Take note of the Application Pool Name)
Now link "C:\Program Files\Sample" in Physical Path
For now leave the binding defaulted, this will trigger wildcard
Uncheck Start Website Immediately
Navigate back to "C:\Program Files\Sample" (Accessible through IIS also)
Right-Click and go to Permissions
Choose add new user
Type in "IIS AppPool\Sample"
Choose access your application will require.
Apply those changes, then navigate and start your web-site.
If that doesn't work, you can check the following:
Application Pool:
Sample should of defaulted to integrated and 4.0, if not change it. If your utilizing .Net Core application, you want it to be Unmanaged Code
Programs and Features:
Make sure that you have .Net 3.5, 3.0, 2.0 enabled.
Hostable Web Core & Internet Information System (Under Web Server) for you.
World Wide Web Services Enabled, with the proper Application Development Features.
Dependencies:
You may have to install https://www.microsoft.com/download/details.aspx?id=53840
If you have Core, you'll need: https://aka.ms/dotnetcore-2-windowshosting
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!
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.