© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
19 replies
Fright

❔ ✅ DotNet Templating Bind Project Name

With dotnet, there is a templating tool. It supports symbol replacement. With that you can bind to various properties.

https://github.com/dotnet/templating/wiki/Binding-and-project-context-evaluation#bind-symbols

I would like to get the project name. This would be whatever the developer submitted for their project name.

There is a feature which replaces the project name, using the
sourceName
sourceName
property, but this is a "safe" project name which uses
_
_
.

I have tried many bindings I would expect to work but none do.
msbuild:projectname
msbuild:projectname

context:projectname
context:projectname

projectname
projectname

targetname
targetname

project
project

name
name


I also tried creating a derived symbol from the source name but I am unable to find the binding for the source name.

Rider doesn't support custom parameter symbols so I want to avoid that for now since Rider is quite popular among my developer audience.
GitHub
Binding and project context evaluation · dotnet/templating Wiki
This repo contains the Template Engine which is used by dotnet new - Binding and project context evaluation · dotnet/templating Wiki
Binding and project context evaluation · dotnet/templating Wiki
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Unable to run dotnet project
C#CC# / help
3y ago
❔ Get full namespace name
C#CC# / help
3y ago
Github actions failing to run project (dotnet run)
C#CC# / help
3y ago
✅ cannot connect console dotnet project with microsoft SQL
C#CC# / help
3y ago