VS2008 插件问题中的亚音速 [英] Subsonic in a VS2008 Add-In woes

查看:31
本文介绍了VS2008 插件问题中的亚音速的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个连接到远程数据库等等的 VS2008 插件.

I am writing a VS2008 add-in that connects to a remote database blah blah.

我在这个项目中的 app.config 有问题.当我在我的代码中使用 SubSonic 时,它抱怨找不到 SubSonicServer 部分.这是因为找不到 .config 文件.这似乎是路径问题,因为加载项是在 VS2008 上下文中运行的 DLL,工作目录是 C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE.

I am having a problem with the app.config in this project. When I use SubSonic in my code, it moans that is cannot find the SubSonicServer section. This is because the .config file cannot be found. This appears to a problem with paths as the add-in is a DLL running in the context of VS2008 and the working directory is C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE.

有没有办法让 app.config 与应用程序一起正确部署,以便我的加载项(和 SubSonic)可以在 .config 文件中找到它需要的内容,或者有没有办法让 SubSonic 在没有需要 .config 吗?

Is there a way to get the app.config to deploy properly with the application so my add-in (and SubSonic) can find what it needs in the .config file, or is there a way to get SubSonic to work without the need for the .config?

我现在对 SubSonic 项目非常有经验,但只有 winforms、web、web service 和 WPF 应用程序.这是我第一次尝试在 VS2008 插件项目中使用 SubSonic.我在配置文件中也有 AppSettings,ConfigurationManager 无法读取它,因为它看不到 .config 文件.

I am very experienced in SubSonic projects now, but only winforms, web, web service, and WPF applications. This is the first time I have tried to use SubSonic in a VS2008 Add-In project. I also have AppSettings in the config file which the ConfigurationManager cannot read because it cannot see the .config file.

现在凌晨 2 点,大脑已经厌倦了试图弄清楚这一点.希望我醒来时有答案:)

2AM now and brain is tired of trying to figure this one out. Hopefully there is an answer when I wake up :)

TIA

推荐答案

我的建议是不要使用 app.config 文件并在运行时注入参数.

My suggestion would be to not use the app.config file and inject the parameters at runtime.

我在我的 Subsonic 2.2 项目中使用这种方法:

I use this approach in my Subsonic 2.2 project:

http://www.digvijay.eu/digvijay.eu/post/2008/10/31/SubSonic-Trick-Specify-connection-string-at-runtime!.aspx

这篇关于VS2008 插件问题中的亚音速的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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