This project is read-only.

Release Build Error


I'm using the project in VS2012 and I'm trying to get the template to create the package. I followed the instructions and Edited the values that were necessary. The project builds without error in Debug mode, but when I change to release mode to have it generate the pacakges, I get an error

Error 2 String was not recognized as a valid Boolean. TestProject

The error doesn't show a line number or any additional information. I have not idea how to track down this error. Has anyone seen this behavior before? I even compared my Project.targets file to that of the DNN FAQ module for any differences and only found that the DesktopFolder tag was missing, after adding that, still no luck. Any ideas?


AlexMacGregor wrote Mar 14, 2014 at 12:21 AM

Root Cause

The issue is a result of no value being specified for the optional azureCompatible parameter of the DNNtc.PackageProperties attribute. The issue is in Components.cs at line #876:
azureCompatible = Convert.ToBoolean(properties[propCount - 1].Trim());
When no value is specified, propCount - 1 ends up trying to convert the value of the company email (e.g. "COMPANYEMAIL") to a boolean value (thus throwing an exception), instead of just defaulting to false.

** Note: ** If you're interested, this MSDN blog posting explains how to debug MSBuild Tasks
(How To: Debug a custom MSBuild task using Visual Studio). I just had to use the 3.5 version instead of 2.0


The template creates View.ascx.cs decorated with the attribute without specifying a value, like this:
However, until this is fixed, you should be able to explicitly set the value for the azureCompatible parameter, like this:

Permanent Solution

I'll submit a patch within the next several days to resolve this - once I figure out how with CodePlex. :-)

AlexMacGregor wrote Mar 14, 2014 at 3:56 PM

Update | Patch Submitted

Reference: Source Code > Patches > #15991

AlexMacGregor wrote Mar 14, 2014 at 4:40 PM

One correction to the workaround too. Don't include the name of the parameter, only the value.
For example:
// Incorrect and will cause a build error!

// Correct way - will build successfully in Release