此项目在Vs2008中以.NET3.5为目标,用于编译视图。
Vs2010目标.net 4.0以下视图代码未作为错误被提取,我也未找到可用于侦听mvcBuildview跟踪/调试输出的代码:
<%{ %>
没有获取完全不匹配的代码块声明,也没有从不存在的命名空间/类继承的部分视图。
<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>
我的预构建:
<Target Name="BeforeBuild">
<WriteLinesToFile File="$(OutputPath)\env.config" Lines="$(Configuration)" Overwrite="true">
</WriteLinesToFile>
<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终极版,VS2008开发者+数据库版在这台机器上。
因此,要么它编译时忽略错误和我尝试过的修复的某些组合,要么它编译错误
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