I have created an ASP.NET project based on the VB.Net Web Forms version of Microsoft's ASP.NET Web Application template and edited to suit my needs.
This project is called MyWebApplicationTemplateMaster and it is dedicated to the sole purpose of exporting a custom template called
MyWebApplicationTemplate, which I intend to use for creating new web applications. The Default.aspx page in MyWebApplicationTemplateMaster contains a reference to the fact that MyWebApplicationTemplateMaster is the source for my template.
However, when I tested this by creating a new project in VS 2019 called MyTestProject based on the MyWebApplicationTemplate, that reference on Default.aspx to 'MyWebApplicationTemplateMaster' was changed to 'MyTestProject'. How do I stop this unwanted text
substitution?
You should expect the new project name to be used for the main namespace. If you create the template correctly, that won't break anything: it will substitute everywhere it needs to. This is the same behavior you'll see when you create a project from one
of the supplied templates.
Hi Kathy,
I always expected that the new project name would be used in all the important places when exploiting a template but I can't see anything in that Microsoft document that refers to text substitution in ordinary page content. I guess there must be a blanket substitution
for all references to the originating project name rather than "everywhere it needs to".
It's not a major problem, but it means that I have to be a little creative when including a reminder in my templates of the project from which they were exported.
Member
102 Points
811 Posts
Unexpected change of text in aspx page contained in template
Sep 25, 2020 09:56 PM|haggis999|LINK
I have created an ASP.NET project based on the VB.Net Web Forms version of Microsoft's ASP.NET Web Application template and edited to suit my needs.
This project is called MyWebApplicationTemplateMaster and it is dedicated to the sole purpose of exporting a custom template called MyWebApplicationTemplate, which I intend to use for creating new web applications. The Default.aspx page in MyWebApplicationTemplateMaster contains a reference to the fact that MyWebApplicationTemplateMaster is the source for my template.
However, when I tested this by creating a new project in VS 2019 called MyTestProject based on the MyWebApplicationTemplate, that reference on Default.aspx to 'MyWebApplicationTemplateMaster' was changed to 'MyTestProject'. How do I stop this unwanted text substitution?
Contributor
5961 Points
2466 Posts
Re: Unexpected change of text in aspx page contained in template
Sep 27, 2020 01:10 AM|KathyW|LINK
You should expect the new project name to be used for the main namespace. If you create the template correctly, that won't break anything: it will substitute everywhere it needs to. This is the same behavior you'll see when you create a project from one of the supplied templates.
How to create project templates: https://docs.microsoft.com/en-us/visualstudio/ide/how-to-create-project-templates?view=vs-2019
Member
102 Points
811 Posts
Re: Unexpected change of text in aspx page contained in template
Sep 27, 2020 10:14 AM|haggis999|LINK
Hi Kathy,
I always expected that the new project name would be used in all the important places when exploiting a template but I can't see anything in that Microsoft document that refers to text substitution in ordinary page content. I guess there must be a blanket substitution for all references to the originating project name rather than "everywhere it needs to".
It's not a major problem, but it means that I have to be a little creative when including a reminder in my templates of the project from which they were exported.
As always, many thanks for your assistance :)