发生了一个错误在处理您的请求时。ASP.NET Core 5.0

huangapple go评论52阅读模式
英文:

An error occurred while processing your request. ASP.NET Core 5.0

问题

请帮助我解决这个问题,当我尝试在Azure上部署我的网站时,尽管我的 ASP_ENVIRONMENT 设置为 Production,仍然出现此问题。请逐步帮助我解决在Azure上的部署。

英文:

发生了一个错误在处理您的请求时。ASP.NET Core 5.0

Please help me solve this issue once I am trying to deploy my website on Azure while my ASP_ENVIRONMENT set to Production still getting this issue. Please help me solve my deployment on Azure step by step

答案1

得分: 1

HDLCAMPUS6275\\SQLEXPRESS 是本地 SQL 服务器,这就是你遇到此问题的原因。

如果你有公共 IP,你可以像下面这样更改连接字符串:

Data Source=public_ip,1433;Initial Catalog=FoodHub;Persist Security Info=True;User ID=sa;Password=Anunay@123;encrypt=true;TrustServerCertificate=True;Max Pool Size=100

你应该在本地使用 SQL Server Management Studio (SSMS) 进行测试。

相关文档:

1. 如何配置 SQL Express 2012 以接受远程连接

2. 从 Visual Studio 生成或查找连接字符串

3. 如果你没有公共 IP,你可以使用 ngrok 进行测试

然后你的问题应该会得到解决。

英文:

HDLCAMPUS6275\\SQLEXPRESS is on-premise sql server, that's why you get this issue.

If you have the public ip, you could change the connectionstring like blow.

Data Source=public_ip,1433;Initial Catalog=FoodHub;Persist Security Info=True;User ID=sa;Password=Anunay@123;encrypt=true;TrustServerCertificate=True;Max Pool Size=100

You should test it in your local by using the sql server management studio(SSMS).

Related docs:

1. How to configure SQL Express 2012 to accept remote connections

2. Generate or find Connection String from Visual Studio

3. If you don't have public ip, you could use ngrok for test

Then your should be fixed.

huangapple
  • 本文由 发表于 2023年2月16日 04:06:28
  • 转载请务必保留本文链接:https://go.coder-hub.com/75464954.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定