.Net标准自定义模板不加载C#文件 [英] .Net Standard custom template does not load C# files

查看:72
本文介绍了.Net标准自定义模板不加载C#文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好


如果我这样做:  新项目...... - > (.Net标准)类库然后
项目 - >导出模板...  我得到一个新的自定义模板,显示在
添加 - >新项目。  但是,包含的Class1.cs文件不会出现在从自定义模板创建的新项目中。具体来说,它不会出现在解决方案资源管理器树中,也不会复制到文件系统中。
csproj文件存在并且通常出现在解决方案资源管理器中,但项目缺少C#文件。 


在我的导出模板的.zip文件中,我看到了该文件正常引用:


< TemplateContent>

  &NBSP; < Project TargetFileName =" ClassLibrary1.csproj"文件= QUOT; ClassLibrary1.csproj" ReplaceParameters =" true">

  &NBSP; &NBSP; < ProjectItem ReplaceParameters =" true" TargetFileName =" Class1.cs"> Class1.cs< / ProjectItem>

  &NBSP; < / Project>

 < / TemplateContent>



此外,Class1.cs文件还在那里在zip中。


我是如何创建自定义.Net标准项目的?

解决方案

嗨CarltonInFarEast,


根据你的描述,我创建演示并在我身边重现你的问题,似乎项目模板不支持.net标准项目模板,我建议你可以在以下链接上发布反馈。 


Hi

If I do this:  New Project ... -> (.Net Standard) Class Library then Project -> Export Template... I get a new custom template that appears in Add -> New Project.  However the included Class1.cs file does not appear in the new project created from the custom template. Specifically it does not appear in the Solution Explorer tree and is not copied into the file system. The csproj file is there and appears normally in the Solution explorer but the project is missing the C# file. 

In the .zip file in My Exported Templates I see that the file is referenced normally:

<TemplateContent>
    <Project TargetFileName="ClassLibrary1.csproj" File="ClassLibrary1.csproj" ReplaceParameters="true">
      <ProjectItem ReplaceParameters="true" TargetFileName="Class1.cs">Class1.cs</ProjectItem>
    </Project>
 </TemplateContent>

Also the Class1.cs file is there in the zip.

Any ideas how I create a custom .Net Standard project?

解决方案

Hi CarltonInFarEast,

According to your description, i create demo and reproduce your issue on my side, it seems that project template does not support .net standard project template, I would suggest that you could post a feedback on the following link. 


这篇关于.Net标准自定义模板不加载C#文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆