Vs2010 MvcBuildViews Not Firing

This project in Vs2008, which targets .net 3.5, is used to compile views.

Vs2010 Targeting.net 4.0, the following view code is not perceived as an error, and I still could not listen to mvcBuildview trace / debug output:

<%{ %> 

The declaration of completely unintended code is not matched, and there was no partial representation inheriting from the nonexistent namespace / class.

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

My BeforeBuild:

 <Target Name="BeforeBuild"> <WriteLinesToFile File="$(OutputPath)\env.config" Lines="$(Configuration)" Overwrite="true"> </WriteLinesToFile> 

My AfterBuild:

 <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)"--> 

I know that the MvcBuildViews property MvcBuildViews true because the message Precompiling views . Compilation is successful, but it does not catch view compilation errors.

I have Vs2010 ultimate, vs 2008 developer + database version on this machine.

Thus, either it compiles ignoring errors with some combinations of corrections that I tried, or errors using

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

The marked sections are the things that I tried. Earlier I tried the corrections from these posts:

+1
source share
1 answer

Error 410 An error occurred while using a partition registered as allowDefinition = 'MachineToApplication' that exceeded the application level. This error can be caused by the fact that the virtual directory is not configured as an application in IIS. web.config 100

Cleaning up a project often helps in fixing this error.

+2
source

Source: https://habr.com/ru/post/970779/


All Articles