Fix Visual Studio 2013 Razor CSHTML Intellisense in Class Library or Console Application
2024-08-24 09:28:18
https://mhusseini.wordpress.com/2015/02/05/fix-visual-studio-2013-razor-cshtml-intellisense-in-class-library-or-console-application/
I tried to use a .cshtml file and the razor syntax in a console application. I was able to build the project, but the intellisense and the error tab complaint about “The name ‘Model’ does not exist in the current context“:
The usual fixes, like throwing in a web.config, didn’t work. But then I found a fix to solve that problem. Here are the steps:
- make sure you have the Microsoft ASP.NET MVC nuget package and its dependecies installed
- clean and build your project, close your .cshtml-files
- copy the following DLLs from Debug (or the mode you’re in) right to the bin folder
- Microsoft.Web.Infrastructure.dll
- System.Web.Helpers.dll
- System.Web.Mvc.dll
- System.Web.Razor.dll
- System.Web.WebPages.Deployment.dll
- System.Web.WebPages.dll
- System.Web.WebPages.Razor.dll
- open your .cshtml file
- it should work
Reason: I guess it’s because in a normal web project there is only a bin folder, no Debug or Release. Visual Studio seems to look directly into that folder for…
最新文章
- ionic overflow:auto失效
- Redis数据库入门教程
- POJ 1850 Code
- 利用闭包向post回调函数传参数
- [ZZ]最小化不可重现的bug
- ntpdate[16603]: the NTP socket is in use
- bookhub -- 扁平化本地电子书管理与分享工具
- Pascal Language: Recommended Materials
- easyui 1.3.3 中combotree post传参问题
- Android学习笔记--获取传感器信息
- 【集训笔记】二分图及其应用【HDOJ1068【HDOJ1150【HDOJ1151
- windows线程同步的总结
- OllyDBG V1.10聆风听雨汉化版
- Lucene全文搜索之分词器:使用IK Analyzer中文分词器(修改IK Analyzer源码使其支持lucene5.5.x)
- 进击的新版NavMesh系统:看我飞檐走壁
- C# 构造器总结
- GIT入门笔记(4)- GIT 安装
- HTTP Status Codes 查询表
- timestamp时间格式
- 分别用for、while和do-while循环语句以及递归方法计算n!,并输出算式