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 ...
随机推荐
- NOIP初赛 BLESS ALL!
祝初赛顺利!RP++! 下午再写一篇题解来加RP
- focusSNS学习笔记
FocusSNS是一个社交类型的网站架构 系统的加载过程 所有的分发都从RouteController开始 @RequestMapping(value={"/", "/h ...
- DevExpress v17.2新版亮点——CodeRush篇(二)
用户界面套包DevExpress v17.2日前终于正式发布,本站将以连载的形式为大家介绍各版本新增内容.本文将介绍了CodeRush v17.2 的新功能,快来下载试用新版本! 支持XAML 标记扩 ...
- JDBC事务控制管理(转载)
JDBC事务控制管理 转载于 2018年01月26日 15:46:11 1.事务 (1)事务的概念 事务指逻辑上的一组操作,组成这组操作的各个单元,要不全部成功,要不全部不成功. 例如:A——B转帐, ...
- 推荐两个Magento做的中文网站 GAP和佰草集
Magento这两年发展很快,可以算是现阶段最有前途的开源电子商务系统,国外用的人很多,相对应的,国内也已经有很多人在用Magento建站了,可惜的是这其中绝大多数还是英文站,大多是国内外贸商建的外贸 ...
- 【linux基础】生成目录下所有图片的路径
command ls *.jpg > list.txt result .png .png .png .png .png command ls /home/xxx/input/*.png > ...
- git中的bug分支和Feature分支
/*游戏或者运动才能让我短暂的忘记心痛,现如今感觉学习比游戏和运动还重要——曾少锋*/ 如果对于分支还不太明白的学者.请先参考:http://www.cnblogs.com/zengsf/p/7512 ...
- 《DSP using MATLAB》Problem 3.20
代码: %% ------------------------------------------------------------------------ %% Output Info about ...
- 【java规则引擎】《Drools7.0.0.Final规则引擎教程》第4章 4.2 auto-focus
转载至:https://blog.csdn.net/wo541075754/article/details/75349556 auto-focus 在agenda-group章节,我们知道想要让Age ...
- CH3602 Counting Swaps
题意 3602 Counting Swaps 0x30「数学知识」例题 背景 https://ipsc.ksp.sk/2016/real/problems/c.html Just like yeste ...