Last post Aug 17, 2016 04:37 PM by CCyrus
Aug 11, 2016 11:57 PM|CCyrus|LINK
I am putting together a Web application using asp.net 5, mvc 6 and am unable to locate the namespace/package for SelectList. From my reading I found that in previous versions (ASP.Net 4 and earlier) that the namespace was System.Web.mvc. However, for asp.net
5 the documentation states that the namespace is: Microsoft.AspNetCore.Mvc.Rendering.
While looking for Nuget Package I am not seeing Microsoft.AspNetCore.Mvc.Rendering as being available.
Any help on this will be very much appreciated.
Aug 12, 2016 12:08 AM|maherjendoubi|LINK
Aug 12, 2016 07:19 PM|CCyrus|LINK
Thank you for your response.
What I found is that I needed and had already installed the Microsoft.AspNet.Mvc package. In the controller I needed to add the “using Microsoft.AspNet.Mvc.Rendering;” statement and then my SelectList was good to go.
Initially I tried installing the Microsoft.AspNetCore.Mvc.ViewFeatures. Compiling resulted in some 52 errors explaining that my references, dependencies and several other items were broken. This appears to be a result of loading an Asp.Net Core (.Net Core)
package in an Asp.Net Web (.Net Framework) application. Oops!
Uninstalling Microsoft.AspNetCore.Mvc.ViewFeatures and making the changes discussed earlier has me back on track.
Thanks again for your help.
Aug 12, 2016 07:27 PM|maherjendoubi|LINK
You're welcome. Is the issue solved then?
Aug 17, 2016 04:37 PM|CCyrus|LINK
This issue is resolved.