从 USB 设备运行应用程序
我正在开发一个概念验证应用程序,其中包含带有控制台主机和客户端的 WCF 服务,两者都位于单个 USB 设备上。在同一设备上,我还将拥有连接到此服务的客户端应用程序。该服务使用实体框架连接到数据库,在此 POC 中数据库将仅返回名称列表。如果有效,它将用于更大的项目。
创建客户端和服务非常简单,并且通过 USB 运行良好。但让服务连接到数据库则不然。我找到了此网站,建议我应该修改 machine.config,但这会停止 XCopy 部署。这个项目不能改变电脑的任何设置,所以这个建议很糟糕。我也无法创建部署设置。整个过程只需要从 USB 磁盘运行即可。
那么,我该如何让它运行呢?
(该服务只是从数据库中选择一个名称列表,然后将其返回给客户端。如果这个 POC 有效,它将执行更复杂的事情!)
I'm working on a proof-of-concept application, containing a WCF service with console host and client, both on a single USB device. On the same device I will also have the client application which will connect to this service. The service uses the entity framework to connect to the database, which in this POC will just return a list of names. If it works, it will be used for a larger project.
Creating the client and service was easy and this works well from USB. But getting the service to connect to the database isn't. I've found this site, suggesting that I should modify machine.config but that stops the XCopy deployment. This project cannot change any setting of the PC, so this suggestion is bad. I cannot create a deployment setup either. The whole thing just needs to run from USB disk.
So, how do I get it to run?
(The service just selects a list of names from the database, which it returns to the client. If this POC works, it will do far more complex things!)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
噢。解决了。只需将其添加到 .config 文件中即可。
将其添加到本地配置文件也可以正常工作。 :-)
Awww. Solved it. Just needed to add this to the .config file.
Adding it to the local config file works just fine too. :-)
您是否考虑过使用内存数据库(如果它适合您的应用程序)。不久前,我曾参与过一个项目,其中将 Web 应用程序作为桌面产品离线提供。我们使用 HSQLDB 作为内存数据库,并且我们运行得很好(数据库也很小)
Have you thought of using an In Memory database (if it suits your application).Some time back i had worked on a project where a web application was given offline as a desktop product.We had used HSQLDB as the in memory database, and for us it worked well (the database was also small)