I'm trying to create a custom VS.NET project and I'm having a problem in one of the templates. I know these templates aren't the same as LLBLGen's, but this seems like a good place to ask for help.
In my .cs files for my VS.NET (2003) project template, I want to do something like this:
[!if DAL_REFERENCED]
using SD.LLBLGen.Pro.ORMSupportClasses;
using [!output MY_PROJECT_NAME].DAL;
using [!output MY_PROJECT_NAME].DAL.DatabaseSpecific;
using [!output MY_PROJECT_NAME].DAL.EntityClasses;
using [!output MY_PROJECT_NAME].DAL.FactoryClasses;
using [!output MY_PROJECT_NAME].DAL.HelperClasses;
[!endif]
The part that doesn't work is the conditional statement. The code is always included, regardless of whether or not DAL_REFERENCED is true or false. In the default.js file for this template, I have the following code:
// add a reference to DotNetNuke project
x = prjs.Count;
VSProject = proj.Object;
refs = VSProject.References;
var bDalReferenced = false;
for (var i=1 ; i<=x ; i++ )
{
tempproject = prjs.item(i);
if(tempproject.name == strMyProjectName + ".DALDBSpecific" ||
tempproject.name == strMyProjectName + ".DAL")
{
ref = refs.AddProject(tempproject);
ref.CopyLocal = false;
bDalReferenced = true;
}
}
wizard.AddSymbol("DAL_REFERENCED", bDalReferenced);
That should allow the conditional in the first code block to work correctly. I'll share the project templates if we can get this working!
By the way, if you haven't figured it out, the idea here is that by adding a new project to a solution which contains projects named <projectname.DAL and <projectname>DALDBSpecific, references are automatically added to those projects. Also, for every new UserControl or WebForm you create, the appripriate usings are added. I go through this process a lot when creating DotNetNuke modules. "DNN Jungle" has a set of project templates for VS.NET, but they're too closely tied to DNN's default data provider and thus useless for us LLBLGeners...
Thanks!