我正在使用实体框架,现在想要发布软件 – 它附加了一个数据实体模型,它作为localhost托管在开发PC上.有没有办法可以释放它,然后它会保留数据库?每次我发布它然后打开程序崩溃;当我发布它时,我很快就会在任何数据库...

我正在使用实体框架,现在想要发布软件 – 它附加了一个数据实体模型,它作为localhost托管在开发PC上.
有没有办法可以释放它,然后它会保留数据库?
每次我发布它然后打开程序崩溃;当我发布它时,我很快就会在任何数据库代码上出现红线错误,然后消失.
任何帮助,将不胜感激.
Edit: Does the Database have to be hosted online?
Edit: It does not crash when I run it in debug mode and it works fine
Edit: I have moved the .exe file onto my Desktop only (not sure if I had to take the whole release file)
Edit: Here is a PrintScreen:
解决方法:
如果您使用的是Entity Framework,那么您的程序将需要这些程序集以及它所依赖的任何其他程序集与.exe文件位于同一文件夹中.可能解释为什么它在Debug中工作正常. Visual Studio会将依赖项复制到输出文件夹中.
本文标题为:c# – 如何使用数据库释放WPF


基础教程推荐
- C# menuStrip控件实现鼠标滑过自动弹出功能 2023-04-22
- .Net Core 使用 System.Drawing.Common 在CentOS下报错 2023-09-27
- Unity接入百度AI实现货币识别 2023-05-12
- C# 利用Autofac批量接口注入依赖的问题小结 2023-05-11
- c#中list.FindAll与for循环的性能对比总结 2022-11-19
- C#实现MQTT服务端与客户端通讯功能 2023-05-16
- Unity C#执行bat脚本的操作 2023-04-10
- C#文件上传与下载的实现方法 2022-11-10
- C#中DateTime的时间加减法操作小结 2023-06-21
- C#中把DataTable、Dataset转Json数据 2023-06-04