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…

Fix Visual Studio 2013 Razor CSHTML Intellisense in Class Library or Console Application的更多相关文章

  1. 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 ...

  2. Visual Studio 2013 支持MVC3不完善,Razor智能提示不完整或者不提示

    以下只是针对MVC3. 前天试用Orchard 1.8,用VS2013新建C#类库项目(ClassLibrary project),然后新建Views文件夹,新建cshtml,然后引用MVC3的相关d ...

  3. Visual Studio 2013 在使用 razor无智能提示的解决办法

    网上看到的方法都差不多,但是我感觉没怎么说详细,因此,截图备注下: 1.开始->Microsoft Visual Studio 2013->Visual Studio  Tools-> ...

  4. Visual Studio 2013 Web开发

    cnbeta新闻:微软正式发布Visual Studio 2013 RTM版,微软还发布了Visual Studio 2013的最终版本..NET 4.5.1以及Team Foundation Ser ...

  5. Visual Studio 2013开启JavaScript的智能提示功能

    在前一次的发布的时候,我们共享了Visual Studio 2013中Windows Azure移动服务的集成和功能.其中包含了移动服务表脚本的编辑能力的介绍.这一次的发布,我们将描述在Visual ...

  6. Visual Studio 2013 Web开发、新增功能:“Browser Link”

    微软正式发布Visual Studio 2013 RTM版,微软还发布了Visual Studio 2013的最终版本..NET 4.5.1以及Team Foundation Server 2013. ...

  7. 使用Visual Studio 2013 调试 MASM 汇编程序!

    原文地址:http://kipirvine.com/asm/debug/vstudio2013/index.htm Using the Microsoft Visual Studio 2013 Deb ...

  8. 在 Visual Studio 2013 中使用 Grunt, Bower 和 NPM

    在 Visual Studio 2015 中提供了对于 Grunt 和 Gulp 的内置支持,在 Visual Studio 2013 中怎么办呢?微软将 2015 中的特性作为几个独立的扩展发布出来 ...

  9. 在ASP.NET MVC5 及 Visual Studio 2013 中为Identity账户系统配置数据库链接及Code-First数据库迁移

    在ASP.NET MVC5 及 Visual Studio 2013 中为Identity账户系统配置数据库链接及Code-First数据库迁移 最近发布的ASP.NET MVC 5 及Visual ...

随机推荐

  1. PHP:第一章——PHP中逻辑运算符的使用方法

    //逻辑运算符 $a=;$b=;$c=;$d=; //逻辑与(and 和 &&)他们两个的逻辑是一样的,如果两个值都为true,结果才为true,否则是false. //var_dum ...

  2. learning scala read from console

    控制台输入语句: readInt, readDouble, readByte, readShort, readLong, readChar, readBoolean, readLine example ...

  3. 给构造函数(constructor)创建对象(object)

    (来源http://www.cnblogs.com/dongjc/p/5179561.html) javascript是一种“基于prototype的面向对象语言“,与java有非常大的区别,无法通过 ...

  4. Django(一)创建和启动项目

    1,使用pycharm 2,新建工程使用django框架 location 最后一个文件夹名就是project名,我用了DjangoProject. Application 是自动加入的APP名字,我 ...

  5. JQ延迟对象

    延迟对象初识 技术一般水平有限,有什么错的地方,望大家指正. ES6已经实现了延迟对象Promise,但是今天主角是JQ里面的延迟对象,套路其实都是差不多的.下面先看一个比较牵强的例子: <bu ...

  6. if...then

    我到现在明白一些道理 有些事情是徒劳无功的 有些却不是 世间事不过如此,只要你肯付出相应的代价,你就可以得到.

  7. 使用Arduino模块实施无线信号的重放攻击

    无线电已经存在使用了很长一段时间,在这很长的一段时间里诞生了一个名叫火腿族的集体(小编:嗯 对 就是整天吃火腿的那些人^_^  CQ CQ ).无线电和互联网一样:同样存在一些安全隐患,比如:在无线信 ...

  8. Linux tomcat自动启动

    1.编辑/etc/rc.d/rc.local 添加环境变量 例如: JAVA_HOME=/usr/local/java/JRE_HOME=/usr/local/java/jreCLASS_PATH=. ...

  9. Netty网络聊天室之会话管理

    写过web的同学们应该对Session这个东西很熟悉.浏览器第一次与服务器建立连接的时候,服务器就会自动为之分配一个Session.Session可以用来判断用户是否经过登录验证,也可以保存用户的各种 ...

  10. 特征工程 —— 特征重要性排序(Random Forest)

    树模型天然会对特征进行重要性排序,以分裂数据集,构建分支: 1. 使用 Random Forest from sklearn.datasets import load_boston from skle ...