MVCContrib便携式区域没有智能感知的ViewPage< T> [英] MVCContrib Portable Area No Intellisense for ViewPage<T>

查看:145
本文介绍了MVCContrib便携式区域没有智能感知的ViewPage< T>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用MVCContrib便携领域。
一般来说,这些工作得很好,它似乎是Web项目之间共享控制器\\美景的好方法。

这是我遇到的唯一问题是,智能感知(具体而言,为的HtmlHelper)未在视图中工作的强类型的观点,即的ViewPage。
然而,智能感知工作的时候认为是一个普通的'醇System.Web.Mvc.ViewPage

有一个类似的问题已经在这里问:
<一href=\"http://stackoverflow.com/questions/2837288/mvccontrib-portable-areas-view-intellisense\">MvcContrib便携式领域的智能感知查看?

但这些建议似乎没有任何区别。

我使用MVC 2,便携式领域是在自己的类库作为MVCContrib样品code。
我还想补充一点,MVC示例,code使我有同样的行为,如果我改变示例项目,使强类型的,那么该视图页面智能感知停止工作。

有同样问题的其他人呢?

有谁知道原因和解决方案或?

从我的浏览文件夹中的web.config如下:

 &LT;?XML版本=1.0&GT?;
&LT;结构&gt;
  &LT;&的System.Web GT;
    &LT;&HttpHandlers的GT;
      &LT;添加路径=*动词=*
          键入=System.Web.HttpNotFoundHandler/&GT;
    &LT; / HttpHandlers的&GT;    &LT;! -
        启用针对网页请求验证会导致验证出现
        之后的输入已经由控制器处理。默认
        MVC控制器处理输入之前执行请求验证。
        要改变这种行为适用ValidateInputAttribute到
        控制器或者动作。
     - &GT;
    &LT;页面
        validateRequest =假
        pageParserFilterType =System.Web.Mvc.ViewTypeParserFilter,System.Web.Mvc,版本= 2.0.0.0,文化=中性公钥= 31BF3856AD364E35
        pageBaseType =System.Web.Mvc.ViewPage,System.Web.Mvc,版本= 2.0.0.0,文化=中性公钥= 31BF3856AD364E35
        userControlBaseType =System.Web.Mvc.ViewUserControl,System.Web.Mvc,版本= 2.0.0.0,文化=中性公钥= 31BF3856AD364E35&GT;
      &LT;控制与GT;
        &LT;添加组件=System.Web.Mvc,版本= 2.0.0.0,文化=中性公钥= 31BF3856AD364E35命名空间=System.Web.Mvc标签preFIX =MVC/&GT;
      &LT; /控制&GT;
    &LT; /页&GT;
  &LT; /system.web>  &LT; system.webServer&GT;
    &LT;验证validateIntegratedModeConfiguration =FALSE/&GT;
    &LT;&处理GT;
      &LT;清除NAME =BlockViewHandler/&GT;
      &LT;添加名称=BlockViewHandler路径=*动词=*preCondition =integratedModeTYPE =System.Web.HttpNotFoundHandler/&GT;
    &LT; /处理器&GT;
  &LT; /system.webServer>
&LT; /结构&gt;


解决方案

这是在VS2010 ReSharper的智能感知,ReSharper的V5.0的一个问题。
如果我改变我的ReSharper的选项(ReSharper->选项 - > Intellisense->常规)使用Visual Studio智能感知那么它的作品!

I am trying out portable areas using MVCContrib. In general these work well and it seems to be a good way to share controllers\views between web projects.

The only problem that I'm having is that Intellisense (specifically, for the HtmlHelper) is not working in the view for strongly typed views i.e. ViewPage. The intellisense does work however when the view is a plain 'ol System.Web.Mvc.ViewPage

A similar questions has been asked here: MvcContrib Portable Areas View Intellisense?

But these suggestions don't seem to make any difference.

I am using MVC 2, the portable areas are in their own class library as in the MVCContrib sample code. I'd also like to add that the MVC sample code gives me the same behaviour, if I change the sample project to make the view page strongly typed then intellisense stops working.

Are other people having the same problem ?

Does anyone know the cause and or solution ?

the web.config from my Views folder is as follows:

<?xml version="1.0"?>
<configuration>
  <system.web>
    <httpHandlers>
      <add path="*" verb="*"
          type="System.Web.HttpNotFoundHandler"/>
    </httpHandlers>

    <!--
        Enabling request validation in view pages would cause validation to occur
        after the input has already been processed by the controller. By default
        MVC performs request validation before a controller processes the input.
        To change this behavior apply the ValidateInputAttribute to a
        controller or action.
    -->
    <pages
        validateRequest="false"
        pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
        pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
        userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <controls>
        <add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
      </controls>
    </pages>
  </system.web>

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <handlers>
      <remove name="BlockViewHandler"/>
      <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/>
    </handlers>
  </system.webServer>
</configuration>

解决方案

This was a problem with ReSharper intellisense in VS2010, ReSharper v5.0. If I change my ReSharper options (ReSharper->Options->Intellisense->General) to use Visual Studio intellisense then it works!!

这篇关于MVCContrib便携式区域没有智能感知的ViewPage&LT; T&GT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆