问题描述
我正在尝试利用.Net Standard 2.0类库中的 Microsoft.VisualBasic
命名空间中的某些静态类( Financial .Rate
函数。)这是一个C#项目,该库包含各种财务函数和计算。我知道仅使用Microsoft.VisualBasic; 添加是不够的,因为我需要引用实际的dll。但是我不确定如何在.net标准类库中执行此操作。
I am attempting to utilize some of the static classes in the Microsoft.VisualBasic
name space in a .Net Standard 2.0 Class library (the Financial.Rate
function specifically.) This is a C# project and the library contains various financial functions and calculations. I know that simply adding the using Microsoft.VisualBasic;
is not enough since I need to reference the actual dll. But I am not sure how to do this in a .net Standard Class library.
我尝试将NuGet软件包 Microsoft.VisualBasic
添加到库中,但这不允许我访问我需要的静态类。我对.Net相当陌生,因此对于如何正确引用程序集感到困惑。我可以找到的所有示例都涉及一些较旧的.net Framework库,而不是.net Standard。下面是参考管理器,解决方案资源管理器和using语句的屏幕快照,如下所示。
I have tried adding the NuGet Package Microsoft.VisualBasic
to the library but that would not allow me to access the static classes that I need. I am rather new to .Net so I am confused about how to properly reference the assembly. All examples that I can find involve some of the older .net Framework libraries and not .net Standard. Below is a link to a screen shot of the reference manager, Solution Explorer and using statements are shown below.
任何帮助或建议都将不胜感激。
Any help or suggestions would be greatly appreciated.
推荐答案
通过NuGet软件包管理器添加NuGet软件包 Microsoft.VisualBasic
Add a NuGet package Microsoft.VisualBasic
via NuGet Package Manager,
或者只是修改项目文件以添加等效的 PackageReference
。
Or simply modify the project file to add an equivalent PackageReference
.
这篇关于如何在.Net标准类库中引用Microsoft.VisualBasic?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!