Creating a new guidance package (Part 2)

Topics: General Discussion Forum, July and December Releases Forum
Mar 31, 2007 at 12:22 AM
I'm getting closer but still getting some errors.

I have successfully built and registered a modified package. When I try to create a project from the custom guidance package I get a series of 2 errors.

The first error is - "A problem was encountered creating the sub project '$serviceImplementationProjectName$'. The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters."

I have looked at the file and path names and they should all be less than 200 characters. The project is also installed in the standard location (i.e. C:\Guidance Web Service Package\ASMX Guidance Package\ASMX Guidance Package). So I'm confussed as to why this error is occuring. The result of the error is it does not create the ServiceImplementation project but it does continue the creation process.

The next error causes the guidance package to terminate. The error is: "Microsoft.Practices.RecipeFramework.RecipeExecutionException: An exception occurred during the binding of reference or execution of recipe CreateASMXSolution. Error was: The following arguments are required and don't have values: DataContractsProject, ServiceImplementationProject, ServiceContractsProject. Can't continue execution." This may be occuring becouse of the first error but I have been unable to overcome or modify either error.

Any help would be much appreciated.

Thanks,

Geordie.
Mar 31, 2007 at 3:56 PM
Did you check that the length of the name of the project prefix combined with the length of the destination path is less than 248 chars?
Can you post this path just to avoid confusions?

Thanks,
Charly
Apr 1, 2007 at 9:06 AM
Hi Charly,

I belive the path would be as follows: "C:\Guidance Web Service Package\ASMX Guidance Package\ASMX Guidance Package\Templates\Solutions\Projects\ASMXTooling.ServiceImplementation\ASMXTooling.ServiceImplementation.vstemplate" which is 184 character long.

To overcome/avoid this problem I started again working from the root directory. Now when I try to create a project I only get the second error message.

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

It is occuring with a different project this time (MessageTypesProject instead of DataContractsProject, ServiceImplementationProject and ServiceContractsProject) otherwise it is the same error I got last time.

Any Thoughts?

Geordie

Apr 2, 2007 at 3:24 PM
When you say "working from the root directory" you mean that you moved the location of your new generated solution or the location of the guidance package? If it it the latter then you may register the package from the new location.

Another thing that is not clear is that the MessageTypesProject argument is not in the CreateASMXSolution, unlike the other arguments like DataContractsProject, ServiceImplementationProject and ServiceContractsProject that are referred in this recipe. Can you explain further how you get the MessageTypesProject argument error and post the complete error stack?

Thanks,
Charly
Apr 2, 2007 at 6:27 PM
Hi Charly

With respect to the location, I moved the location of the 'Web Service Software Factory' Guidance Package to a folder called 'ASMX GP Source' on the C drive (In the 'Web Service Software Factory' install that I used it did not install the web services factory source code by default but did give me an option to install it from the programs->Microsoft patterns & proctices->Web Service Software Facotry->ASMX Guidance Package Source Code). Installing the source code this way allowed me to specify where the code was installed. Initially I used the default location as specified in the documentation but got the path length error so I extracted another copy of the source code but this time placed it in a folder on the C drive.

Here is the error stack that I recieve when tring to create a project from the modified guidance package.

Microsoft.Practices.RecipeFramework.RecipeExecutionException: An exception occurred during the binding of reference or execution of recipe CreateASMXSolution. Error was: The following arguments are required and don't have values: MessageTypesProject. Can't continue execution..
You can remove the reference to this recipe through the Guidance Package Manager.
at Microsoft.Practices.RecipeFramework.Recipe.ThrowIfRequiredArgumentsAreNull(IDictionaryService arguments)
at Microsoft.Practices.RecipeFramework.Recipe.Execute(Boolean allowSuspend)
at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(String recipe, IAssetReference reference, IDictionary arguments)
at Microsoft.Practices.RecipeFramework.GuidancePackage.ExecuteFromTemplate(String recipe, IDictionary arguments)
at Microsoft.Practices.RecipeFramework.VisualStudio.Templates.UnfoldTemplate.ExecuteRecipe(Boolean executeActions)
at Microsoft.Practices.RecipeFramework.VisualStudio.Templates.UnfoldTemplate.RunFinished()

Here is the code that has been added to the CreateASMXSolution.xml file for the MessageTypeProject (as per the 'How to create a new guidance package that includes your configuration settigs (ASMX)' example in the help files)

<Argument Name="MessageTypeProjectName">
<ValueProvider Type="Evaluator"
Expression="$(NamespacePrefix).MessageType">
</ValueProvider>
</Argument>
<Argument Name="MessageTypesProject" Type="EnvDTE.Project, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Converter Type="ProjectConverter" />
<ValueProvider Type="Microsoft.Practices.RecipeFramework.Extensions.ValueProviders.VisualStudio.ProjectByPathExpressionProvider, Microsoft.Practices.RecipeFramework.Extensions"
PathExpression="Source\Service\$(MessageTypeProjectName)"
Stage="OnBeforeActions">
</ValueProvider>
</Argument>
<Argument Name="MessageTypeNamespace">
<Converter Type="XmlNamespaceStringConverter" />
<ValueProvider Type="XmlNamespaceProvider"
ProjectNameArgument="MessageTypeProjectName">
<MonitorArgument Name="MessageTypeProjectName"/>
</ValueProvider>
</Argument>

AND

<Action Name="AddReference2ToServiceContractsProject" Type="Referencer">
<Input Name="ReferringProject" RecipeArgument="ServiceContractsProject"/>
<Input Name="ReferencedProject" RecipeArgument="MessageTypesProject"/>
</Action>
<Action Name="AddReferenceToMessageTypesProject" Type="Referencer">
<Input Name="ReferringProject" RecipeArgument="MessageTypesProject"/>
<Input Name="ReferencedProject" RecipeArgument="DataContractsProject"/>
</Action>

AND

<Action Name="SetMessageTypeNamespace" Type="AddProjectGlobalsEntryAction" PropertyName="MessageTypeNamespace">
<Input Name="Project" RecipeArgument="MessageTypesProject" />
<Input Name="PropertyValue" RecipeArgument="MessageTypeNamespace" />
</Action>

I spent several hours yesterday going over the example to try and determine where the problem was but came up blank. Any ideas are welcome.

Thanks,

Geordie
Apr 4, 2007 at 3:36 AM
You should change the PathExpression vavlue in the ValueProvider of the MessageTypesProject argument, from "Source\Service\$(MessageTypeProjectName)" to "Source\Service Interface\$(MessageTypeProjectName)". So the new value should be like this:

<Argument Name="MessageTypesProject" Type="EnvDTE.Project, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
 <Converter Type="ProjectConverter" />
    <ValueProvider Type="Microsoft.Practices.RecipeFramework.Extensions.ValueProviders.VisualStudio.ProjectByPathExpressionProvider, Microsoft.Practices.RecipeFramework.Extensions"
          PathExpression="Source\Service Interface\$(MessageTypeProjectName)"
          Stage="OnBeforeActions">
    </ValueProvider>
</Argument>
Other than that, you should be fine if you followed all the steps in that How To.
Charly
Apr 4, 2007 at 6:00 AM
Thanks Charly,

That was the problem. I guess there is a typo in that How To as the code was a direct copy and paste.

Thanks again.

Geordie