简体   繁体   中英

Asp.net 5 IHostingEnvironment exists in both

In Startup constructor I'm getting parameter IHostingEnvironment and it can not resolve namespace:

"The type IHostingEnvironment exists in both Microsoft.AspNet.Hosting.Abstractions and Microsoft.AspNet.Hosting.Interfaces"

I write: Microsoft.AspNet.Hosting.IHostingEnvironment in ctor parameters, but I'm still getting this error. What I'm doing wrong?

在此处输入图片说明

Nuget settings:

在此处输入图片说明

You have both beta5 and beta4 packages together as your dependencies. They don't play nice together. Align all your dependency versions to beta5 ones. Run dnu list to see all resolved dependencies at the end.

More info: http://davidfowl.com/diagnosing-dependency-issues-with-asp-net-5/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM