Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any way configure to configure visual studio mvc build views release mode

Is there any way to configure visual studio to compile views when compiling for release mode only. It seems that its all or nothing and for my project which has lots of different views it just bogs down to where I turn it off but forget to turn it on during pushes to QA.

like image 238
MikeJ Avatar asked Jun 21 '13 15:06

MikeJ


People also ask

How do I create a release mode in Visual Studio?

In Solution Explorer, right-click the project and choose Properties. In the side pane, choose Build (or Compile in Visual Basic). In the Configuration list at the top, choose Debug or Release. Select the Advanced button (or the Advanced Compile Options button in Visual Basic).

What is the difference between debug mode and release mode in Visual Studio?

By default, Debug includes debug information in the compiled files (allowing easy debugging) while Release usually has optimizations enabled. As far as conditional compilation goes, they each define different symbols that can be checked in your program, but they are language-specific macros.

What's the difference between debug and release?

Release vs Debug and it depends on what language you are using, Debug includes debugging information in the compiled files (allowing easy debugging) while Release usually has optimizations enabled. They each define different symbols that can be checked in your program, but they are language-specific macros.

What is debug build and release build?

Debug build and release build are just names. They don't mean anything. Depending on your application, you may build it in one, two or more different ways, using different combinations of compiler and linker options.


1 Answers

You could wrap it in a <PropertyGroup>

Example

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <MvcBuildViews>true</MvcBuildViews>
</PropertyGroup>
like image 70
Colin Bacon Avatar answered Sep 27 '22 23:09

Colin Bacon