One of my main tasks working at the United Nation and the European Commission Joint Research Centre was to get all developers on the same page with developing in DotNetNuke. This is a difficult task in itself as everybody has their own flavour. So the best way to tackle this was to introduce the DotNetNuke templates. I used the ones from Chris Hammond on CodePlex both C# and VB to do this. They ran straight out of the box and with some minor customisations we are all on the same page, until! Moving over to Visual Studio 2010 an issue arose which would not build the package.
The main difference, is that in the Visual Studio 2010 version, the 42353,42354,42355 value has been added; Inside the IDE, this manifests itself as the following setting in the Project Properties | Compile section as:
"Function returning intrinsic value type without return value" = None
This isn't a problem when building code inside Visual Studio 2010, but when trying to build the code through our continuous integration scripts, it fails with the following errors:
[msbuild] vbc : Command line error BC2026: warning number '42353' for the option 'nowarn' is either not configurable or not valid
[msbuild] vbc : Command line error BC2026: warning number '42354' for the option 'nowarn' is either not configurable or not valid
[msbuild] vbc : Command line error BC2026: warning number '42355' for the option 'nowarn' is either not configurable or not valid
Now you could just edit *.*proj project file and delete all occurrences of 42353,42354,42355 which isn’t the sweetest of options.
This solution is more simple than I first thought, but when it is right in front of you nose it is not that obvious.
As we are using visual studio 2010 we have you changed the build script file in the template to use the 4.0 version of MSBuild?
To fix this, follow Chris’s blog Using and Customizing a C# Module Development Template and add this step.
Open up the ModuleName.build in a text editor and locate the line (line 45)
and change to
Save the file and repackage.The templates run great and I will be doing a few more customisations to meet our development needs.
On further reflection, adding a few more configuration items to the template to create a more robust solution.
- In the prj file remove the version number of the DotNetNuke Reference. This is load the DotNetNuke.dll from the defined folder.
- Also in the prj file at the
add the framework tag v3.5