How to Reference Microsoft.VisualBasic in a .Net Standard Class Library?

我是研究僧i 提交于 2019-12-10 16:55:36

问题


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.

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.

Reference Manager Screen Shot

Solution Explorer

Using Statements & Implementation

Any help or suggestions would be greatly appreciated.


回答1:


Add a NuGet package Microsoft.VisualBasic via NuGet Package Manager,

https://www.nuget.org/packages/Microsoft.VisualBasic/

Or simply modify the project file to add an equivalent PackageReference.



来源:https://stackoverflow.com/questions/48897920/how-to-reference-microsoft-visualbasic-in-a-net-standard-class-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!