我创建了一个视觉工作室模板,效果很好。但是当我尝试使用这个新模板将新项目添加到我的解决方案中时,我收到以下错误:
"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"
Run Code Online (Sandbox Code Playgroud)
背景资料:
我的解决方案包含一个在我的项目模板中引用的共享项目
我的项目模板 *.csproj 中的导入语句如下所示:
<Import Project="..\..\Common\Shared\XY.projitems" Label="Shared" />
Run Code Online (Sandbox Code Playgroud)
该错误消息让我非常困惑。有人给我提示吗?
使用模板创建新项目的项目结构如下:
Solution_XY
- SharedProject
- PluginsFolder
- Project_1
- Project_2
- Project_3
Run Code Online (Sandbox Code Playgroud)
创建的项目位于解决方案中的特殊项目文件夹中。所以Project_1到Project_3在模板创建时需要有对SharedProject的引用。