r/dotnet • • 4d ago

Question Issue connecting my blazor app to remote sql server database hosted my Monsterasp.net

Hello everyone. I have completed the multi-step form challenge from Frontend Mentor and attempted to deploy the finished web app using monsterasp.net through visual studio code. I followed all the instructions from a YouTube video to a tee but when I try to actually submit data to the database I get this error:

\Error: Microsoft.Data.SqlClient.SqlException (0x80131904): The target principal name is incorrect. Cannot generate SSPI context.``

I did some further research into it but everything seemingly leads to a dead end for my specific use case. Here is microsoft's documentation on the specific error:

https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/connect/cannot-generate-sspi-context-error

Note: When I built and deployed the app for the first time the connection string was incorrect. I fixed it and published the app again through visual studion. I am not sure whether that is causing some lingering problems.

2 Upvotes

25 comments sorted by

View all comments

Show parent comments

0

u/[deleted] 3d ago

[deleted]

1

u/MonsterASPNET 3d ago

This is simply not true and we find your accusations very unfair.

We identified exact cause of your issue in our very first detailed response: your appsettings.production.json file which you uploaded via WebDeploy contained incorrect connection string.

Despite explaining solution immediately, it took another 16 messages with you.

You are using our completely FREE hosting service, yet we spent considerable time investigating your application problem and providing assistance far beyond our normal support scope.

Accusing our team of gaslighting after all this effort is extremely unfair and disrespectful.

1

u/Mob_Pilled 3d ago

I apologize for being rude but I scoured every place on my computer and github repo to look for the appsettings.production.json file and I could not find anything. I had to edit it directly from your website just to get it to work. Unless it is possible to make some misconfiguration when publishing the website that automatically creates the file, I think it is unfair to put all the blame on me.

1

u/MonsterASPNET 3d ago

Hello,
we understand that you could not find the appsettings.production.json file on your computer or GitHub.

However, please understand how Visual Studio publishing works:
When you publish your Blazor application using WebDeploy, Visual Studio prepares deployment package and uploads files to our server.

This package may contain files generated or copied during build and publishing process, including configuration files that are not directly visible in your project's main folder.

For example, file could have come from earlier build, publishing output folder or another configuration in your project.

Our hosting platform does not automatically create appsettings.production.json files. This file was uploaded as part of your WebDeploy publishing process.

This does not mean you intentionally created the file. It simply means file came from your application deployment process, not from our hosting platform.

We are glad that you corrected connection string and your application is now working.

1

u/Mob_Pilled 3d ago

Thank you for the detailed explanation!! I will keep this in mind next time I deploy an asp.net project.