I have a console app without a project reference to any ASP.NET MVC App. Running Visual Studio 2010.
I created a cshtml file to test some template binding. I am not getting IntelliSense in the cshtml and putting "@model MyDataClass" at the beginning of the page is not getting recognized either.
How can get some View functionality in my console app?
Thanks.
Follow instructions in this blog post - https://blogs.msdn.microsoft.com/webdev/2011/01/20/how-to-get-razor-intellisense-for-model-in-a-class-library-project/
Also, add references to System.Web.Razor.dll and System.Web.WebPages.Razor.dll
Try using RazorEngine it allows you to use Razor templating in Console applications.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With