[英]Visual Studio C# Project Template: $safeprojectname$ parameter
Visual Studio C# Project Template: $safeprojectname$ parameter Visual Studio C#项目模板:$ safeprojectname $参数
i'm trying to create a project template and i want to replace some file names to safeprojectname. 我正在尝试创建一个项目模板,我想将一些文件名替换为safeprojectname。
It works for source file however it did not work project file (.csproj) itsef. 它适用于源文件,但不适用于项目文件(.csproj)。
<TemplateContent>
<Project TargetFileName="$safeprojectname$.csproj" File="$safeprojectname$.csproj" ReplaceParameters="true">
<Folder Name="Definition File" TargetFolderName="Definition File">
<ProjectItem ReplaceParameters="true" TargetFileName="$safeprojectname$.txt">$safeprojectname$.txt</ProjectItem>
</Folder>
<TemplateContent>
Is it possible to use $safeprojectname$ in project file naming? 是否可以在项目文件命名中使用$ safeprojectname $?
safeprojectname: The name provided by the user in the New Project dialog box, with all unsafe characters and spaces removed. safeprojectname:用户在“新建项目”对话框中提供的名称,其中删除了所有不安全的字符和空格。
If it is not possible to use $safeprojectname$ in projet name itself i need know the what are the unsafe characters that will removed . 如果无法在projet名称本身中使用$ safeprojectname $,我需要知道要删除的不安全字符是什么 。
i need know the what are the unsafe characters that will removed
我需要知道将删除哪些不安全字符
Same as what Path.GetInvalidFileNameChars() returns. 与Path.GetInvalidFileNameChars()返回的相同。 So in practice any character in
:\\/*?"<>|
. Note how these characters do special things when used at the command line and when composing a full path name. Having them appear in a project file name would cause lots of trouble. 因此,在实践中,
:\\/*?"<>|
中的任何字符:\\/*?"<>|
注意,这些字符在命令行中使用时以及在组成完整路径名时如何做特殊事情。将它们出现在项目文件名中会带来很多麻烦。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.