首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Vs2010 MvcBuildViews不开火

Vs2010 MvcBuildViews不开火
EN

Stack Overflow用户
提问于 2010-06-01 16:05:51
回答 1查看 2.3K关注 0票数 1

这个项目在Vs2008中针对.net 3.5用来编译视图。

Vs2010针对.net 4.0没有将以下视图代码作为错误提取,而且我仍然没有发现要侦听mvcBuildview跟踪/调试输出:

代码语言:javascript
复制
<%{ %>

没有获取完全不匹配的代码块声明,也没有从不存在的命名空间/类继承的部分视图。

代码语言:javascript
复制
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'DebugWithBuildViews|AnyCPU' ">

<!--<BaseIntermediateOutputPath>bin/intermediate</BaseIntermediateOutputPath>-->
<!--<MvcBuildViews Condition=" '$(Configuration)' == 'DebugWithBuildViews' ">true</MvcBuildViews>-->
<EnableUpdateable>false</EnableUpdateable>
<MvcBuildViews>true</MvcBuildViews>
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<RunCodeAnalysis>true</RunCodeAnalysis>
 </PropertyGroup>

我的BeforeBuild:

代码语言:javascript
复制
<Target Name="BeforeBuild">
<WriteLinesToFile File="$(OutputPath)\env.config" Lines="$(Configuration)" Overwrite="true">
</WriteLinesToFile>

我的AfterBuild:

代码语言:javascript
复制
<Target Name="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
<!--<BaseIntermediateOutputPath>[SomeKnownLocationIHaveAccessTo]</BaseIntermediateOutputPath>-->
<Message Importance="high" Text="Precompiling views" />
  <!--<AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)..\$(ProjectName)" />-->
<!--<AspNetCompiler VirtualPath="temp" />-->
<!--PhysicalPath="$(ProjectDir)\..\$(ProjectName)"-->

我知道MvcBuildViews属性是真的,因为Precompiling views消息是通过的。编译是成功的,但它没有捕获视图编译错误。

我有Vs2010终极,vs 2008 developer+database版在这台机器上。

因此,它要么使用我尝试过的一些修复组合来编译忽略错误,要么使用它进行错误编译。

Error 410 It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS. web.config 100

注释掉的部分是我以前尝试过的--我尝试过从这些帖子中修复:

EN

回答 1

Stack Overflow用户

发布于 2010-06-01 16:08:38

错误410 --在应用程序级别之外使用一个注册为allowDefinition='MachineToApplication‘的部分是一个错误。此错误可能是由于未将虚拟目录配置为IIS中的应用程序造成的。web.config 100

清理项目通常有助于防止此错误。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2951358

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档