简体   繁体   English

C#MVC Razor名称空间Microsoft.VisualBasic.Financial无法解析

[英]C# MVC Razor namespace Microsoft.VisualBasic.Financial not resolving

I am using MVC 3 Razor .cshtml pages. 我正在使用MVC 3 Razor .cshtml页面。 I have included the Microsoft.VisualBasic reference into my project and use it just fine in existing web forms pages. 我已经将Microsoft.VisualBasic参考包含到我的项目中,并且可以在现有的Web表单页面中很好地使用它。 But within my view it will not resolve the Financial NameSpace. 但是在我看来,它不会解决财务命名空间。 It sees Microsoft.VisualBasic just fine but the only thing intellisense brings up is Microsoft.VisualBasic.Activities and Microsoft.VisualBasic.VBCodeProvider. 它认为Microsoft.VisualBasic很好,但是intellisense提出的唯一内容是Microsoft.VisualBasic.Activities和Microsoft.VisualBasic.VBCodeProvider。 Attempting to use Financial results in a compile error of: 尝试使用财务会导致以下编译错误:

The type or namespace name 'Financial' does not exist in the namespace 'Microsoft.VisualBasic' 类型或名称空间名称“ Financial”在名称空间“ Microsoft.VisualBasic”中不存在

Any help is greatly appreciated i need to use the NPV function under financial. 非常感谢您的帮助,我需要在财务状况下使用NPV功能。

该类型位于Microsoft.VisualBasic.dll中 ,请确保您具有对该类型的引用,以便能够在Razor中使用它。

I ended up just creating a static Finance class that i can make calls to that have access to that namespace. 最后,我只创建了一个静态Finance类,可以对该类进行调用,从而可以访问该名称空间。 This of course ends up being more reusable anyway. 当然,这最终将变得更加可重用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM