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 ...
随机推荐
- linux page allocation and deallocation
All of the physical pages in the system are described by the mem_map data structure which is a li ...
- scrapy-redis介绍(一)
scrapy是python里面一个非常完善的爬虫框架,实现了非常多的功能,比如内存检测,对象引用查看,命令行,shell终端,还有各种中间件和扩展等,相信开发过scrapy的朋友都会觉得这个框架非常的 ...
- bzoj1002
题解: f[i]=(f[i-1]*3+f[i-2]); 高精度计算 代码: #include<bits/stdc++.h> using namespace std; struct big ...
- ReentrantReadWriteLock——写写互斥(二)
"读写" ."写读"."写写"都是同步的.互斥的 1.Service.java package ReentrantReadWriteLock ...
- XML——Schema
body, table{font-family: 微软雅黑; font-size: 10pt} table{border-collapse: collapse; border: solid gray; ...
- Express文件上传之Multer
Express文件上传之Multer Multer是一个nodejs中间件,用来处理http提交multipart/form-data,也就是文件上传.它是在busboy的基础上开发的. 在我看来,M ...
- 算法训练 P1103
算法训练 P1103 时间限制:1.0s 内存限制:256.0MB 编程实现两个复数的运算.设有两个复数 和 ,则他们的运算公式为: 要求:(1)定义一个结构体类型来描述复数. ...
- 基础练习 Huffuman树
基础练习 Huffuman树 时间限制:1.0s 内存限制:512.0MB 问题描述 Huffman树在编码中有着广泛的应用.在这里,我们只关心Huffman树的构造过程. 给 ...
- Eclipse SVN 使用教程
Eclipse SVN 使用教程 做好以上的准备后打开Eclipse编译器,点击编译器右上角的Open Perspective 打开SVN资源库界面,新建一个资源库 选择资源库的位置,这里我们就用刚才 ...
- jQuery -- 如何使用jQuery判断某个元素是否存在
通常我们要判断某个元素是否存在是用: if(document.getElementById('example')) { // do something } else { // do something ...