简体   繁体   English

在 ASP.NET next MVC 项目中使用类库

[英]Using a class library in a ASP.NET next MVC project

I am trying to create a website with the last version of MVC.我正在尝试使用最新版本的 MVC 创建一个网站。 My MVC project is running fine.我的 MVC 项目运行良好。 I have a class library created with yeoman, it's running fine too.我有一个用 yeoman 创建的类库,它也运行良好。 I added my library in the MVC project.son我在 MVC project.son 中添加了我的库

"dependencies": {
[...]
"ServicesAndDbContext": ""
},

If I run with the cmd dmx run it's ok BUT when I try to use my class library I have an error : "The type or namespace name 'ServicesAndDbContext' could not be found (are you missing a using directive or an assembly reference?) [dnx451] " This line appear when I write my : using ServicesAndDbContext;如果我使用 cmd dmx run 运行它没问题但是当我尝试使用我的类库时我有一个错误:“找不到类型或命名空间名称'ServicesAndDbContext'(您是否缺少 using 指令或程序集引用?) [dnx451] " 当我写我的 : using ServicesAndDbContext 时出现这一行;

Could you please tell me what am I doing wrong?你能告诉我我做错了什么吗?

Thank you very much!非常感谢!

Ok, Thank you Bruno Garcia you found my problem.好的,谢谢布鲁诺·加西亚,你发现了我的问题。

dnx451 was missing under the framework section.框架部分下缺少 dnx451。

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

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