数据上下文 SubmitChanges() 毫无例外地退出代码 - 在 iis5.1 上部署.net mvc

发布于 2024-07-14 16:07:18 字数 421 浏览 3 评论 0原文

我刚刚在 .NET MVC 中部署了我的第一个应用程序,但遇到了问题。

我已经解决了 iis 5.1 的路由问题(如果有人正在寻找这个问题,请转到这里: http://itscommonsensestupid。 blogspot.com/2008/11/deploy-aspnet-mvc-app-on-windows-xp-iis.html

**现在我的问题是,无论我在数据上下文中调用 db.SubmitChanges() ,它似乎阻止代码继续并且不进行更新。 发布网站时是否遗漏了某个步骤? **

I have just deployed my first application in .NET MVC and i'm having issues.

I have resolved the iis 5.1 problems with the routing (If anyone is looking for this go here:
http://itscommonsensestupid.blogspot.com/2008/11/deploy-aspnet-mvc-app-on-windows-xp-iis.html )

**Now my issue is that wherever I call db.SubmitChanges() on my data context it seems to stop the code from continuing and doesn't do the update. Is there a step I'm missing when publishing my website? **

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

小女人ら 2024-07-21 16:07:18

您可能遇到了与我尝试过的同样的问题

linq to sql Insert 在部署的服务器(IIS)上不起作用

哦,找出任何错误的好方法是因为我没有收到任何异常,或者将所有数据库代码放入 try catch 中并返回“pass” 或者如果返回 ex.ToString() 失败,

您还可以将错误代码放入 viewdata 对象并使用 <%= ViewData["errorMessage" 在视图上输出] %>

you probably have run into the same issue I did try this

linq to sql Insert not working on deployed server(IIS)

oh and a good way to find out any errors cause i wasnt getting any exceptions either is to throw all your db code into a try catch and return "pass" or if failed return ex.ToString()

you can also throw the error code into a viewdata object and output on your view by using <%= ViewData["errorMessage"] %>

椒妓 2024-07-21 16:07:18

这是我导出 web 应用程序时数据库只读的问题。 它没有给我一个很好的错误消息或异常,尽管它似乎崩溃了。 我在 IIS 下进行了检查,它尝试使用的用户帐户仅具有读取权限。

一旦我更改了此设置,我就重新启动了 IIS(不是我第一次意外执行的停止/启动),问题就解决了

This was a problem with the database being read only when i exported the webapp. It didn't give me a nice error message or exception though it jut seemed to break. I checked under IIS and the user account it was trying to use only had read permissions.

Once i changed this i restrarted IIS (not stop/start which i did the first time by accident) and the problem was resolved

迷雾森÷林ヴ 2024-07-21 16:07:18

我建议查看事件日志,看看是否记录了有关应用程序退出原因的任何信息。 另外,我建议您发布您正在运行的平台。 特别是 64 位?

I suggest looking in the Event Log to see if any information was logged as to why the application exits. Also, I suggest you post what platform you're running on. In particular, 64-bit?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文