info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
User profile is available. Using 'C:\Users\mayuying\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
Hosting environment: Production
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5000/
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1]
Executing action method Souti.Web.Controllers.HomeController.Index (Souti.Web) with arguments ((null)) - ModelState is Valid
fail: Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.ViewResultExecutor[3]
The view 'Index' was not found. Searched locations: /Views/Home/Index.cshtml, /Views/Shared/Index.cshtml
info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2]
Executed action Souti.Web.Controllers.HomeController.Index (Souti.Web) in 32.3144ms
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]
An unhandled exception has occurred: The view 'Index' was not found. The following locations were searched:
/Views/Home/Index.cshtml
/Views/Shared/Index.cshtml
请问我在 vs上访问可以 但是我使用dotnet 命令启动完成功 但是 访问报错 请问是什么原因啊?
你是在哪个路径下运行 dotnet run 命令的?
\bin\Debug\netcoreapp2.0 下执行的
@马玉溁: 应该在 Web 项目所在的文件夹中直接运行 dotnet run
@dudu: 嗯 这样是可以的 我在 项目的 目录里先 build 然后在run 就可以了 ; 我之前 是用的 dotnet web.dll 是可以启动的 我是从网上看的 但是 为什么会报错 能说一下 原因吗? 谢谢
@马玉溁: \bin\Debug\netcoreapp2.0
中没有视图文件,如果使用 dotnet web.dll
运行,需要先用 dotnet publish
命令进行发布,发布的目标文件夹中会包含视图文件
@dudu:您好系我想问一下我发布到linux 以后 也能运行期来项目 但是 会有一个警告
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
No XML encryptor configured. Key {52feaee2-ad3f-44a4-a545-a7550bcc1a98} may be persisted to storage in unencrypted form. 这个是什么原因呢 有没有影响呢? 谢谢
@dudu: 好的谢谢dudu