部署应用程序时无法从web api获取localDB数据。 [英] Unable to get localDB data from web api when app is deployed.

查看:131
本文介绍了部署应用程序时无法从web api获取localDB数据。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在IIS上部署了我的web api应用程序解决方案。当我进入网站的根页面时,我现在能够看到我的主页索引。这很好但是当我尝试获取请求192.xxx.xxx.xxx/api/AH(AH是我的控制器名称)时,它只返回Json错误。我正在使用实体框架6.



I have deployed my web api application solution on IIS full. I am now able to see my home page index when I go to the root page of the site. That is fine but when I try to make a get request 192.xxx.xxx.xxx/api/AH (AH being my controller name) it only returns Json error. I am using Entity Framework 6.

{
Message: "An error has occurred."
}





它应该从我的localDB获取数据。我尝试的是添加我的文件夹的权限。在IIS和VS中检查连接字符串。我已经检查了我的应用程序池

我该怎么办?我被困了。



It should be getting data from my localDB. What I tried is to add permissions to my folder. Checked connection strings in IIS and in VS. I've checked my application pool
What can I do? I'm stuck.

推荐答案

我修好了它。我刚刚使用了SQL Server Express数据库并使用了它的连接字符串。谢谢!
I fixed it. I just used an SQL Server Express database and used it's connection string. Thank you!


这篇关于部署应用程序时无法从web api获取localDB数据。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆