引用旧类库的ASP.Net 5项目 [英] ASP.Net 5 project referencing old class library

查看:180
本文介绍了引用旧类库的ASP.Net 5项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用ASP.Net 5项目和服务项目的存储库模式.我将我的" .Service"类库项目引用到了我的" .Web"项目中,但是引用出了点问题.我删除了所有对其他库的引用,甚至删除了我的" .Service"和" .Web"项目,并添加了新的空项目,但是新创建的" .Web"项目仍引用旧版本删除的" .Service"项目.

I was trying repository pattern with ASP.Net 5 project and service project. I referenced my ".Service" class library project into my ".Web" project but something went wrong with the reference. I removed all referenced to other libraries, even removed my ".Service" and ".Web" projects and added new empty ones but the newly created ".Web" project still referencing the old version of deleted ".Service" project.

" .Web"> ASP.Net 5项目. " .Service"> .Net Framework 4.5.1类库项目.

".Web" > ASP.Net 5 project. ".Service" > .Net Framework 4.5.1 class library project.

[github上项目的URL] https://github.com/ahmedhelmy204/Publess/tree/master/Publess

[URL for project on github] https://github.com/ahmedhelmy204/Publess/tree/master/Publess

当前问题状态的屏幕截图

推荐答案

您的存储库没有Publess.Data,您引用了该存储库,并在错误的位置包含了Publess.Core(请参阅

Your repository don't Publess.Data, which you reference and includes Publess.Core on the wrong place (see here and compare with github.com/ahmedhelmy204/Publess/tree/master/Publess/artifacts/...). Moreover the wrap folder contains EntityFramework.SqlServer and EntityFramework, which should be removed.

例如,目录wrap/EntityFramework.SqlServer包含project.json,其中EntityFramework的版本号为1.0.0,并且通知从.../Publess.Data/bin/Debug文件夹获取EntityFramework.SqlServer.dll

The directory wrap/EntityFramework.SqlServer for example contains project.json with wrong version number 1.0.0 for EntityFramework and it informs to get EntityFramework.SqlServer.dll from .../Publess.Data/bin/Debug folder

{
  "version": "1.0.0-*",
  "frameworks": {
    "net451": {
      "bin": {
        "assembly": "../../Publess.Data/bin/Debug/EntityFramework.SqlServer.dll"
      },
      "dependencies": {
        "EntityFramework": "1.0.0-*"
      }
    }
  }
}

将旧项目或旧程序集添加到新的ASP.NET 5项目时,将创建wrap文件夹.将创建带有assemblypdb的条目wrappedProjectbin.可以使用Visual Studio或dnu wrap来执行此操作(请参见dnu wrap -h).参见答案帖子.

The wrap folder will be created when you add old project or old assembly to new ASP.NET 5 project. The entries wrappedProject and bin with assembly and pdb will be created. One can use Visual Studio or dnu wrap to do this (see dnu wrap -h). See the answer, the documentation or the post.

一些其他建议可以为您提供dnu wrap的源代码.参见此处和这里

Some additional advices can gives you the source code of dnu wrap. See here and here and here

这篇关于引用旧类库的ASP.Net 5项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆