问题描述
Hello All,
我在处理项目时遇到困难。我有一个VB.NET前端Windows应用程序集,我在c#类库中实现了所有业务逻辑。现在我想从C#类库中读取VB.NET程序集的配置文件(app.config)。
我在互联网上查看了大量的网站人们建议使用ConfigurationManager类。但是当我尝试使用它时,我可以在intellisense中获得该项目。我错过了什么吗?我也导入了System.Configuration命名空间。
这就是我在VB.NET程序集的App.config中所拥有的。
Hello All,
I got stuck while working with a project. I have a VB.NET front end windows app assembly and I implemented all business logic in a c# class library. Now I want to read the configuration file (app.config) of VB.NET assembly from C# Class library.
I reviewed lot of site on the Internet and most of the people recommended using ConfigurationManager class. But when I try to use it I can get that item in the intellisense. Am I missing something? I have imported System.Configuration namespace as well.
This is what I have in my App.config of VB.NET assembly.
<connectionstrings>
<add name="Dev" connectionstring="Data Source=(local);Initial Catalog=SMS;User Id=sa;Password=****;" providerName="System.Data.SqlClient" />
</connectionstrings>
请帮我看看如何阅读此连接来自我的C#程序集的字符串。
非常感谢提前。
Please help me on how to read this connection string from my C# assembly.
Many thanks in advance.
推荐答案
这篇关于从同一解决方案中的C#类库程序集中读取VB.NET程序集的app.config - Reg。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!