找不到Visual Studio项目模板* .projitems

时间:2020-05-03 08:09:58

标签: c# visual-studio project-template

我创建了一个视觉工作室模板,效果很好。但是,当我尝试使用此新模板将新项目添加到解决方案中时,出现以下错误:

"The imported project "c:\users\xy\AppData\Local\Temp\Common\Shared\XY.projitems" was not found. Confirm 
that the expression in the import declaration "..\..\Common\Shared\XY.projitems" is correct and that the 
file exists on disk."c:\users\xy\AppData\Local\Temp\qfuczw4e.apk\Temp\MyTemplate1.csproj"

背景信息:

我的解决方案包含一个共享项目,该项目在我的项目模板中被引用

我的项目模板的* .csproj中的import语句如下:

<Import Project="..\..\Common\Shared\XY.projitems" Label="Shared" />
  • *。projitems文件存在与上述相对路径有关。
  • 文件在上述路径“ c:\ users \ xy \ AppData \ Local \ Temp \ qfuczw4e.apk \ Temp \”中不存在

该错误消息使我非常困惑。有人对我有提示吗?

更新

将使用模板创建新项目的项目结构如下:

Solution_XY

   - SharedProject

   - PluginsFolder
     - Project_1
     - Project_2
     - Project_3

创建的项目位于解决方案内的特殊项目文件夹中。因此,在模板创建时,Project_1至Project_3需要引用SharedProject。

0 个答案:

没有答案