hi
ive got a item template that i have created, this one is made to create a custom visual web part.
the .vstemplate is defined as follows
<VSTemplate Version="2.0.0" Type="Item"
xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
<TemplateData>
<Name>Widget Template</Name>
<Icon>Icon.ico</Icon>
<Description>HFEA Widget Template</Description>
<ProjectType>CSharp</ProjectType>
<DefaultName>wpWebpart</DefaultName>
</TemplateData>
<TemplateContent>
<ProjectItem ReplaceParameters="true" TargetFileName="$fileinputname$\$fileinputname$.cs">
wpWebPart3_Incidents12Months.cs
</ProjectItem>
<ProjectItem ReplaceParameters="true" TargetFileName="$fileinputname$\$fileinputname$.webpart">
wpWebPart3_Incidents12Months.webpart
</ProjectItem>
<ProjectItem ReplaceParameters="true" TargetFileName="$fileinputname$\$fileinputname$UserControl.ascx">
wpWebPart3_Incidents12MonthsUserControl.ascx
</ProjectItem>
<ProjectItem ReplaceParameters="true" TargetFileName="$fileinputname$\$fileinputname$UserControl.ascx.cs">
wpWebPart3_Incidents12MonthsUserControl.ascx.cs
</ProjectItem>
<ProjectItem ReplaceParameters="true" TargetFileName="$fileinputname$\$fileinputname$UserControl.ascx.designer.cs">
wpWebPart3_Incidents12MonthsUserControl.ascx.designer.cs
</ProjectItem>
<ProjectItem ReplaceParameters="true" TargetFileName="$fileinputname$\SharePointProjectItem.spdata">
SharePointProjectItem.spdata
</ProjectItem>
<ProjectItem ReplaceParameters="true" TargetFileName="$fileinputname$\Elements.xml">
Elements.xml
</ProjectItem>
</TemplateContent>
</VSTemplate>
and for nearly all the files it works fine , and the ReplaceParameters works perfectly to put in the correct names and namespaces etc.
but for the following :-
<ProjectItem ReplaceParameters="true" TargetFileName="$fileinputname$\SharePointProjectItem.spdata">
SharePointProjectItem.spdata
</ProjectItem>
<ProjectItem ReplaceParameters="true" TargetFileName="$fileinputname$\Elements.xml">
Elements.xml
</ProjectItem>
it doesnt work.
basically its meant to go into each of these files and replace some tags with the item name specified at the "add new item" dialog.
it seems to ignore the name specified in "add new item" and just simply uses the name of the file ,
the example for Elements.xml here is whats inside it.
="1.0"="utf-8"
<Elements xmlns="http://schemas.microsoft.com/sharepoint/" >
<Module Name="$safeitemrootname$" List="113" Url="_catalogs/wp">
<File Path="$safeitemrootname$\$safeitemrootname$.webpart" Url="$safeitemrootname$.webpart" Type="GhostableInLibrary" >
<Property Name="Group" Value="Custom" />
</File>
</Module>
</Elements>
what it should do is replace $safeitemrootname$ with the name specified in the "add new item" dialog.
but instead it replaces $safeitemrootname$ with the name "Elements" instead.
it seems to be because i am not renaming the file , if i use
TargetFileName="$fileinputname$\$fileinputname$.Elements.xml
it works fine , but then i have to in the project rename it back to Elements.xml.
has anyone come across this , or know what needs to be added to get it to work correctly.