So i have a localdb set up for my project in Visual Studio but when I publish it to my Azure web app, I get "
所以我在Visual Studio中为我的项目设置了localdb,但是当我将它发布到我的Azure Web应用程序时,我得到了“
An unhandled exception occurred while processing the request. Win32Exception: The system canot find the file specified TryGetConnection"
处理请求时发生未处理的异常。 Win32Exception:系统canot找到指定的文件TryGetConnection“
I tried adding a "DefaultConnection" Connection String with the database/server as the value in the Web App settings but that didn't do anything
我尝试添加一个“DefaultConnection”连接字符串与数据库/服务器作为Web应用程序设置中的值,但没有做任何事情
1 个解决方案
#1
3
LocalDb doesn't exist for Azure. LocalDb is a feature of SQL Server Express, there is no equivalency of that on the service (machine) you are deploying your App Service website on.
Azure不存在LocalDb。 LocalDb是SQL Server Express的一项功能,在您部署App Service网站的服务(机器)上没有相同的功能。
There are plenty of options instead of LocalDb when you go to Azure. The easiest (and recommended) is to use an Azure SQL database and replace your connectionstring with one that points to that instead when you publish your website.
当你去Azure时,有很多选项而不是LocalDb。最简单(也是推荐)是使用Azure SQL数据库,并在您发布网站时将链接替换为指向该数据库的连接字符串。
Some other options are discussed here Using a LocalDb MDF file on Azure
此处讨论了一些其他选项在Azure上使用LocalDb MDF文件
#1
3
LocalDb doesn't exist for Azure. LocalDb is a feature of SQL Server Express, there is no equivalency of that on the service (machine) you are deploying your App Service website on.
Azure不存在LocalDb。 LocalDb是SQL Server Express的一项功能,在您部署App Service网站的服务(机器)上没有相同的功能。
There are plenty of options instead of LocalDb when you go to Azure. The easiest (and recommended) is to use an Azure SQL database and replace your connectionstring with one that points to that instead when you publish your website.
当你去Azure时,有很多选项而不是LocalDb。最简单(也是推荐)是使用Azure SQL数据库,并在您发布网站时将链接替换为指向该数据库的连接字符串。
Some other options are discussed here Using a LocalDb MDF file on Azure
此处讨论了一些其他选项在Azure上使用LocalDb MDF文件