简体   繁体   English

如何在 .Net 标准类库中引用 Microsoft.VisualBasic?

[英]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参考管理器屏幕截图

Solution Explorer解决方案资源管理器

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.

相关问题 如何使用Microsoft.VisualBasic引用在MonoDevelop中使用IsNumeric方法? - How to use IsNumeric method in MonoDevelop by using Microsoft.VisualBasic reference? 添加对Microsoft.VisualBasic的引用后无法获得InputBox - Cannot get InputBox after adding reference to Microsoft.VisualBasic System.TypeLoadException Microsoft.VisualBasic ASP.NET Core 2 - System.TypeLoadException Microsoft.VisualBasic ASP.NET Core 2 Microsoft.VisualBasic集合的方法中的可选参数 - Optional Parameters in methods of Microsoft.VisualBasic Collection 即使我添加了对项目的引用并包含 Microsoft.VisualBasic,Interaction.InputBox 也不存在 - Interaction.InputBox does not exist even though I add reference to project and include Microsoft.VisualBasic 即使在导入 Microsoft.VisualBasic 后,.Net Core Strings.Asc/Mid/Chr/Len 也会丢失 - .Net Core Strings.Asc/Mid/Chr/Len missing even after importing Microsoft.VisualBasic 引用 VB.NET 项目的 C# 项目:找不到程序集“Microsoft.VisualBasic,版本 10.0.0.0” - C# project referring to VB.NET project: Could not find assembly 'Microsoft.VisualBasic, Version 10.0.0.0' Microsoft.VisualBasic ComputerInfo的基于单声道的替换 - Mono-based Replacement for Microsoft.VisualBasic ComputerInfo 命名空间“Microsoft.VisualBasic”中不存在类型或命名空间名称“FileIO” - The type or namespace name 'FileIO' does not exist in the namespace 'Microsoft.VisualBasic' VB 代码到 C# - 命名空间 Microsoft.VisualBasic - VB Code to C# - Namespace Microsoft.VisualBasic
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM