引用旧类库的ASP.Net 5项目 [英] ASP.Net 5 project referencing old class library
问题描述
我正在尝试使用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
(请参阅 github.com/ahmedhelmy204/Publess/tree/master/Publess/artifacts/... ).此外,包装文件夹包含EntityFramework.SqlServer
和EntityFramework
,应将其删除.
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
文件夹.将创建带有assembly
和pdb
的条目wrappedProject
和bin
.可以使用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屋!