2017-09-05 53 views
0

的 「dotnet的」 命令得到錯誤的當前應用程序路徑在.NET 1.1核心如何在運行命令「dotnet project.dll」時在.net core 1.1中獲得正確的應用程序路徑?

我的項目的代碼路徑:"e:/master/net/demo/demoMvc.csproj"

我的項目發佈路徑:"e:/master/net/demo/publish"

當我運行命令"dotnet demoMvc.dll""dotnet e:/master/net/demo/publish/demoMvc.dll""e:/master/net/demo/publish",這是沒問題的。

但是當運行命令"dotnet e:/master/net/demo/publish/demoMvc.dll"不在"e:/master/net/demo/publish"這條路上時,總是錯誤的。

我的代碼:

enter image description here

錯誤圖像:

enter image description here

導致更多的錯誤:沒有發現所有的頁面!

1. enter image description here

2. enter image description here

+0

你可以添加你project.cs 10號線的問題?或所有主要功能? – msd

+0

@msd是的,已添加。 –

回答

-1
var path = Path.Combine(env.WebRootPath, "images"); 

此去wwwroot文件 - >圖像

相關問題