Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Models from Portable Class Libraries

$
0
0

How do I reference a Portable Class Library as a model in creating a view.   I have all of my models in this library to work with a Windows universal app created in Visual Studio 2015 and now I am trying to create a web application using ASP.Net Core 1.1 in visual studio 2017.

I can access the models and data in the controller and pass that data through a viewbag.   However, when I declare the portable library with @using in a view cshtml it generates an error saying "the type or namespace could not be found".

I was hoping to be able to use the "Add View" but it doesn't list any of my models from these libraries in the models drop-down.  Is there a service or something I need to add in my startup to recognize a library added to this web project.   Thanks.


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>