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…
Fix Visual Studio 2013 Razor CSHTML Intellisense in Class Library or Console Application的更多相关文章
- Solving GitHub FetchHead (MergeConflict) in Visual Studio 2013
I was getting the error: An error occurred. Detailed message: An error was raised by libgit2. Catego ...
- Visual Studio 2013 支持MVC3不完善,Razor智能提示不完整或者不提示
以下只是针对MVC3. 前天试用Orchard 1.8,用VS2013新建C#类库项目(ClassLibrary project),然后新建Views文件夹,新建cshtml,然后引用MVC3的相关d ...
- Visual Studio 2013 在使用 razor无智能提示的解决办法
网上看到的方法都差不多,但是我感觉没怎么说详细,因此,截图备注下: 1.开始->Microsoft Visual Studio 2013->Visual Studio Tools-> ...
- Visual Studio 2013 Web开发
cnbeta新闻:微软正式发布Visual Studio 2013 RTM版,微软还发布了Visual Studio 2013的最终版本..NET 4.5.1以及Team Foundation Ser ...
- Visual Studio 2013开启JavaScript的智能提示功能
在前一次的发布的时候,我们共享了Visual Studio 2013中Windows Azure移动服务的集成和功能.其中包含了移动服务表脚本的编辑能力的介绍.这一次的发布,我们将描述在Visual ...
- Visual Studio 2013 Web开发、新增功能:“Browser Link”
微软正式发布Visual Studio 2013 RTM版,微软还发布了Visual Studio 2013的最终版本..NET 4.5.1以及Team Foundation Server 2013. ...
- 使用Visual Studio 2013 调试 MASM 汇编程序!
原文地址:http://kipirvine.com/asm/debug/vstudio2013/index.htm Using the Microsoft Visual Studio 2013 Deb ...
- 在 Visual Studio 2013 中使用 Grunt, Bower 和 NPM
在 Visual Studio 2015 中提供了对于 Grunt 和 Gulp 的内置支持,在 Visual Studio 2013 中怎么办呢?微软将 2015 中的特性作为几个独立的扩展发布出来 ...
- 在ASP.NET MVC5 及 Visual Studio 2013 中为Identity账户系统配置数据库链接及Code-First数据库迁移
在ASP.NET MVC5 及 Visual Studio 2013 中为Identity账户系统配置数据库链接及Code-First数据库迁移 最近发布的ASP.NET MVC 5 及Visual ...
随机推荐
- SQL Server如何清除曾经登录过的登录名
我用的是SQL Server2008数据库,在数据库登录界面,有时我们用户已经在安全性已经删除了,但是登录名痕迹还是存在, 那如何删除掉这些用户登录过的登录记录呢? 我本机是要删除这个登录名为s的记录
- Oracle 固定执行计划-使用SPM(Sql Plan Management)固定执行计划
固定执行计划-使用SPM(Sql Plan Management)固定执行计划 转载自:http://www.lunar2013.com/2016/01/固定执行计划-使用spm%EF%BC%88sq ...
- 为何 Delphi的 Local Variables 突然没有值显示了
可能是上次编译后 code未再修改过. 试试 随便 输入一个空格,然后F9
- 关于rimworld(边缘之地)
低缓的音乐 广阔的原野 丰富而不杂乱的地表 完美的殖民拓荒世界. 各种随机地形,丰富的资源.林木与矿产.随机生成的大世界给人真实世界的感觉. 动态而和谐的画面,随风摇摆的植被,跳跃的兔子,以及 ...
- HslControls组件库 工业控件库 曲线控件 时间控件 管道控件 温度计控件 阀门控件 传送带控件 进度条控件 电池控件 数码管控件等等
本篇博客主要对 HslControls 组件做一个大概的总览介绍,更详细的内容可以参照页面里的子链接,还有github上的源代码,然后进行相关的学习,和使用. Prepare 先从nuget下载到组件 ...
- SSH项目搭建(三)——Maven多模块搭建项目
多模块开发,大致的思想就是把一个项目按某种方式分成多个模块,再把模块们连接成一个整体,我们在开发的时候,可以很清晰的操作每一个模块,可以大大提高开发的效率. Java web项目,最常见的就是按代码的 ...
- 使用Ant搭建Android开发环境入门
使用Ant搭建Android开发环境入门 使用Ant搭建Android开发环境,建立android项目 配置Ant环境 下载Ant:http://ant.apache.org/bindownloa ...
- Ubuntu16.04怎样安装Python3.6
Ubuntu16.04默认安装了Python2.7和3.5 请注意,系统自带的python千万不能卸载! 输入命令python
- UNIMRCP 代码走读
基于UNIMRCP1.5.0的代码走读 与 填坑记录 1. server启动配置加载 入口:unimrcp_server.c static apt_bool_t unimrcp_server_load ...
- what is bitcoin