2

我在嘗試使用ASP.Net 5項目和服務項目的存儲庫模式。我將我的「.Service」類庫項目引用到我的「 .Web」項目中,但引用出錯。我刪除了所有引用的其他庫,甚至打消了我的「。服務」和「名.web」項目,並添加了新的空的,但新創建的「名.web」項目仍引用舊版本中刪除「。服務」的項目。ASP.Net 5項目引用舊類庫

名.web」> ASP.Net 5項目。 「 .Service」> .Net Framework 4.5.1類庫項目。

[URL項目在github] https://github.com/ahmedhelmy204/Publess/tree/master/Publess

Screenshot of the current issue state

+0

你的倉庫不'Publess.Data'您參考,幷包括'在錯誤的地方Publess.Core'(見[這裏](https://github.com/ahmedhelmy204/Publess /blob/master/Publess/wrap/Publess.Core/project.json#L7-L8)並與https://github.com/ahmedhelmy204/Publess/tree/master/Publess/artifacts/bin/Publess.Web比較) 。而且'wrap'文件夾包含了'EntityFramework.SqlServer'和'EntityFramework',它們應該被刪除。你能更新你的倉庫嗎? – Oleg

+0

感謝奧萊德,它在包裝和重建中刪除文件夾後工作。 請將它標記爲正確答案。 –

+0

另外,如果你添加了一個關於wrap文件夾的鏈接並且它是可行的,我將不勝感激。 –

回答

2

你的倉庫不Publess.Data,你就錯了地方引用,包括Publess.Core(見heregithub.com/ahmedhelmy204/Publess/tree/master/Publess/artifacts/...比較)。此外渦卷文件夾包含EntityFramework.SqlServerEntityFramework應刪除

例如目錄wrap/EntityFramework.SqlServer包含project.json與錯誤的版本號1.0.0EntityFramework,並通知從.../Publess.Data/bin/Debug文件夾獲取EntityFramework.SqlServer.dll

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

當您添加老項目或老裝配到新的wrap文件夾將被創建ASP.NET 5項目。條目wrappedProjectbinassemblypdb將被創建。可以使用Visual Studio或dnu wrap來執行此操作(請參閱dnu wrap -h)。見the answerthe documentationthe post

一些額外的建議可以給你的dnu wrap的源代碼。看到這裏和herehere