[英]How to Reference Microsoft.VisualBasic in a .Net Standard Class Library?
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.我试图在 .Net Standard 2.0 类库(特别是
Financial.Rate
函数)中利用Microsoft.VisualBasic
命名空间中的一些静态类。这是一个 C# 项目,该库包含各种财务函数和计算。 I know that simply adding the using Microsoft.VisualBasic;
我知道只需添加
using Microsoft.VisualBasic;
is not enough since I need to reference the actual dll.还不够,因为我需要引用实际的 dll。 But I am not sure how to do this in a .net Standard Class library.
但我不确定如何在 .net 标准类库中执行此操作。
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.我曾尝试将 NuGet 包
Microsoft.VisualBasic
添加到库中,但这不允许我访问所需的静态类。 I am rather new to .Net so I am confused about how to properly reference the assembly.我对 .Net 比较陌生,所以我对如何正确引用程序集感到困惑。 All examples that I can find involve some of the older .net Framework libraries and not .net Standard.
我能找到的所有示例都涉及一些较旧的 .net Framework 库,而不是 .net Standard。 Below is a link to a screen shot of the reference manager, Solution Explorer and using statements are shown below.
下面是参考管理器屏幕截图的链接,解决方案资源管理器和 using 语句如下所示。
Reference Manager Screen Shot参考管理器屏幕截图
Using Statements & Implementation使用语句和实现
Any help or suggestions would be greatly appreciated.任何帮助或建议将不胜感激。
Add a NuGet package Microsoft.VisualBasic
via NuGet Package Manager,通过 NuGet 包管理器添加一个 NuGet 包
Microsoft.VisualBasic
,
https://www.nuget.org/packages/Microsoft.VisualBasic/ https://www.nuget.org/packages/Microsoft.VisualBasic/
Or simply modify the project file to add an equivalent PackageReference
.或者简单地修改项目文件以添加等效的
PackageReference
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.