Modifications to factory to alleviate file name length problems

Topics: Service Factory Modeling Edition Forum
May 22, 2008 at 2:22 AM
Has any one modified the Web Service Software Factories to remove some of the folders to make a flatter folder structure? We have been using the previous version and after creating the solution we have had to go back and remove folders and flatten the structure. This still allowed the factory to work in the previous version, but does not in the modeling addition. A flatter folder structure would also match the Patterns & Practices Guidance for TFS source control $ProjectName\Main\Source\[functionalName]\Source\[VS Projects]\[Project Code] 
Developer
May 22, 2008 at 10:01 AM
Hi, can you give further details regarding why the current modeling edition does not work with a flatter structure?
As far as we know, you may update the VS template that unfolds the solution and projects with whatever structure you like and it should work as expected. Notice that if you remove projects, then you may add the roles of those projects to som other projects so they may end up with more then one role per project but that is perfectly fine.
May 23, 2008 at 8:53 PM
Thanks for the quick response, we have worked through most of the issues. I have added what we found below.
We still have a couple of Questions. Is it possible to create solution folders but not physical folders? and can we stop the name spaces being appended to the physical folders? We would still like to have our projects and dll's have the full namespace.

Here are the steps to flatten the folder structure (not sure how to create non-physical solution folders yet).

STEP 1:

Open [Install Path]\Guidance Package\Templates\Projects\WCF.vstemplate with Notepad, then remove the <SolutionFolder> elements from the <ProjectCollection> section as desired.

Here is an example of what it may look like after editing:

<ProjectCollection>

<ProjectTemplateLink ProjectName="$safeprojectname$.BusinessEntities">WCFBusinessEntity\BusinessEntity.vstemplate</ProjectTemplateLink>

<ProjectTemplateLink ProjectName="$safeprojectname$.BusinessLogic">WCFBusinessLogic\BusinessLogic.vstemplate</ProjectTemplateLink>

<ProjectTemplateLink ProjectName="$safeprojectname$.DataAccess">WCFDataAccess\DataAccess.vstemplate</ProjectTemplateLink>

<ProjectTemplateLink ProjectName="$safeprojectname$.DataContracts">WCFDataContract\DataContract.vstemplate</ProjectTemplateLink>

<ProjectTemplateLink ProjectName="$safeprojectname$.FaultContracts">WCFFaultContract\FaultContract.vstemplate</ProjectTemplateLink>

<ProjectTemplateLink ProjectName="$safeprojectname$.MessageContracts">WCFMessageContract\MessageContract.vstemplate</ProjectTemplateLink>

<ProjectTemplateLink ProjectName="$safeprojectname$.ServiceImplementation">WCFServiceImplementation\ServiceImplementation.vstemplate</ProjectTemplateLink>

<ProjectTemplateLink ProjectName="$safeprojectname$.ServiceContracts">WCFServiceContract\ServiceContract.vstemplate</ProjectTemplateLink>

<SolutionFolder Name="Tests">

<ProjectTemplateLink ProjectName="$safeprojectname$.Host">WCFHost\Host.vstemplate</ProjectTemplateLink>

<ProjectTemplateLink ProjectName="$safeprojectname$.Client">WCFClient\Client.vstemplate</ProjectTemplateLink>

<SolutionFolder Name="Functional Tests"/>

<SolutionFolder Name="Unit Tests" />

</SolutionFolder>

</ProjectCollection>

STEP 2:

Modify [Install Path]\Guidance Package\Recipes\Common\CreateService.xml to reflect the path changes in WCF.vstemplate.

Change all PathExpression attributes by removing the folders from the path that were removed from WCF.vstemplate.

In this example, the default attribute:

PathExpression="Source\Resource Access\$(DataAccessProjectName)"

would be changed to:

PathExpression="$(DataAccessProjectName)"

If you do not complete this step, you will get the following error message after adding a WCF Implementation:

Microsoft.Practices.RecipeFramework.RecipeExecutionException: An exception occurred during the binding of reference or execution of recipe CreateWCFService. Error was: The following arguments are required and don't have values: MessageContractsProject, FaultContractsProject, DataContractsProject. Can't continue execution.

STEP 3:

Modify [Install Path]\Guidance Package\Recipes\CreateWCFService\CreateWCFService.xml just like you did in STEP 2.

If you do not complete this step, you will get the following error message after adding a WCF Implementation:

Microsoft.Practices.RecipeFramework.RecipeExecutionException: An exception occurred during the binding of reference or execution of recipe CreateWCFService. Error was: The following arguments are required and don't have values: DataAccessProject, BusinessEntitiesProject, BusinessLogicProject, ServiceImplementationProject, ServiceContractsProject, MessageContractsProject, FaultContractsProject, DataContractsProject. Can't continue execution.

Developer
May 26, 2008 at 1:01 PM
You can set as a project name any name you want and have only the namespace of the project be a composition of any kind of combination regardless its lenght. Then the assembly name may by something different then the  namespace and therefore be "path" friendly as well.
Check inside the project csproj file to check how the namespace and assembly name is formed. Also check inside the project's vstemplate file regarding the project name composition.