Can't log into ASP.NET MVC site once on IIS - asp.net

I finally got my ASP.NET MVC application hosted on my local Windows/IIS server. I went to the login page but when I try to log in it says,
Error:
An error occurred while processing your request
This is fairly non-descript...
My gut feeling is that when I did the web deploy, I didn't deploy the localdb(?) where the users' credentials are stored. Before I try to re-deploy the entire app, I'd like to see if anyone can offer some guidance. Am I on the right track? Are there other possible causes/solutions I should investigate?
I'm using the default registration/login system that is in the project to start with, and it woks just fine in VS. I did a regular web deploy to my IIS server, and the site works just fine until you go to log in.

Fixed: This issue was caused (as suspected) by the inaccessibility of the LocalDB where all the users' credentials are stored. VS uses this light DB instead of making you install SQL Express or another alternative (much like IIS Express works better for debugging than full IIS). When I push my application to IIS from VS, the database wasn't connecting. I eventually found this other SO question, and the top answer fixed my issue.
How to deploy ASP.NET MVC 4 application using localDB to local IIS on Windows 7?
This will solve the issue, but there is a lot of conflict on the web as to whether or not it is ok to use LocalDB in production, so if you have a lot riding on your project you might want to take a look at that. For my purpose, LocalDB is just fine, so this solved the issue. Thank you to all who responded to my (admittedly) broad question. I'm sure this will be a useful thread for others with the same issue.

Related

ASP.NET Core Runtime 3.1.9

Morning All
I am hosting my website on IIS , the website was built using the react template. But I have ran into a problem. When using localhost my webapp worked a charm, i could interact with the database and life was good. But now ive moved it over to IIS Im no longer able to pull data in from the database or interact with the db.
I think the problem may be the fact that IIS is running on a different server to my local machine. I have the ASP Core runtime installed on my local machine but not on the server where IIS is situated.
Can someone just confirm to me that I do require ASP Core runtime to be installed on the IIS server also?
Im not able to test things out until tomorrow otherwise I would find out for my self. Apologies, im basically a beginner with IIS and ASP
Thanks
If you are facing troubles with the database connection and not with your API endpoints could be network/proxy/firewall stuff. But if you're not able to deploy your API to IIS maybe could be that you're missing the Net Core bundle. For more information check the link below:
https://dotnet.microsoft.com/download/dotnet-core/thank-you/runtime-aspnetcore-3.1.9-windows-hosting-bundle-installer
Yes, you are required to have the ASP.NET Core runtime installed if you plan on running asp.net-core applications on it.

Why do my LDAP calls occasionally fail with these messages?

I am developing an intranet ASP.NET web application that's configured to use Integrated Windows Authentication. My web app needs to check user entitlements using LDAP to get user memberships, etc.
The issue I noticed today is that, when I run my web app using IIS, sometimes the LDAP calls fail with strange errors, such as "Unable to contact the server..." ... or "...that domain doesn't exist..." (something along those lines, anyway). However, if I run my web app using Cassini, I don't get those errors.
If IIS is the issue, why would it fail some times and other times not? What does Cassini do different that IIS is not doing?
I'm using IIS 5.1 / Windows XP / Visual Studio 2008
Why is this happening, and how can I fix it?
Probably something to do with the fact that when you're running Cassini, it's your domain account that's querying the LDAP. It is strange that it would work in IIS sometimes though, and not others. Is the server registered on the network? What system account is IIS running under?
#James Johnson: I figured it out thanks to your comment, which got me thinking about my domain account... Finally, I found this post which points out that in order to connect to LDAP one needs to set Impersonation=True in web.config. It was working intermittently this morning, I think, because I was using Firefox instead of IE, which required me to enter my domain username and password.
The other strange thing was that my app worked fine in our development and stage environments even though my web.config is the same for all of them. I suppose the guys in the hosting group have this set at the machine.config level.

What causes a 403 error on a local Azure development environment?

I have an Azure application that works perfectly on every one of my colleagues machines. On mine, the web application works, but not the azure project, which runs on the local development fabric.
I'm getting a 403 error, which causes a blank page in Chrome. The application_start method gets fired and sets up the routes, but the actual MVC controller never gets called. Again, this works perfect if I run the web application directly. If I use that same azure project and deploy it online, it also works fine.
I've tried repairing visual studio, reinstalling Azure, rebooting, re-fetching source, you name it.
I'm desperate for ideas! What would cause a 403?
Here is the answer. Looks like I wasn't the first to be victimized by this:
http://scottdensmore.typepad.com/blog/2010/05/how-a-checkbox-saved-paving-my-machine.html
What's interesting is that I wasn't even using IIS.
You need IIS for dev fabric. Cloud service projects do not run on the asp.net web server inbuilt in visual studio. Refer this.
So any configuration issues in IIS will affect you.

Unable to start debugging on the web server. The COM+ registry database detected a system error

I'm trying to debug an ASP.NET webapp that's configured to "Use Local IIS Web Server" on WinXP. When I start the debugger, the compile succeeds, and then the following error is displayed in a dialog:
Unable to start debugging on the web
server. The COM+ registry database
detected a system error
The webapp never launches in my browser. How can I get rid of this message and debug this webapp?
I tried the usual stuff, and my exact scenario ended up being described a post in the MSDN forums. Its answer worked for me, despite my environment (VS2008, .NET 3.5) being more modern:
Here are the steps I followed (basically a summary of the link above -- "ASPNET" being significant because that's the user running the IIS instance on my development box):
Close VS
Shutdown IIS
Add ASPNET to the local Administrators group
Start IIS
Start VS and successfully debug ASP.NET webapp
Close VS
Shutdown IIS
Remove ASPNET from the local Administrators group
Start IIS
Start VS and continue debugging ASP.NET webapp without error
My development workstation's security settings/situation is regularly managed by our security folks here, so something must have upset my ASP.NET/IIS/etc environment.
I am using the Visual Studio 2002 and I had the same problem, with tha same Error Message. To solve it, I did only the first 5 steps of the solution recommended before.
I am starting in VS 2002 because I use it in my work. I have the basic concepts, but I never develop in this program language, so I am a begginer.
The most important point in this solution I believe it is understand that ASPNET is a user in the development machine, as Administrator, as "Name.LastName" or any other user that access the machine. When I search for ASPNET to add in the Administrators Group and found it, made a lot more sense because I don't know exactly how the .NET architecture works.
So, if you have the same problem, I here confirm this solution solved my problem, even when I reboot my machine:
Close VS
Shutdown IIS
Add ASPNET user of the Machine to the local Administrators group
Start IIS
Start VS and successfully debug ASP.NET webapp
Thanks for the solution!!

Debug a hosted asp.net site?

Is it possible to debug (with VS 2008) a site at my host? I have no particular control of the server, I'm only allowed to upload my website files to the server. I can however upload .pdb files etc.
The reason for me wanting this is because the site works fine on my dev machine, but refuses to show even the first page when deployed on the server (404-error).
Maybe a long-shot, but in my experience the "works-on-my-machine-but-returns-404-on-the-server" problem is often a consequence of that the WebServer Extension "ASP.NET v2.0.50727" is prohibited.
As Ganesh R points out, it may sound like your application never gets startet.
As for the debugging part, I don't think you would be able to pull that off...
Debugging requires that certain debugging components are installed and enabled on the server. This is highly unlikely to be the case on any production hosting platform.
Contact your hosting provider - they will usually be quite willing to help you diagnose the problem you are encountering.

Resources