如何在vstemplate的csproj中处理相对的Compile包含

时间:2013-12-11 08:23:15

标签: visual-studio visual-studio-templates

我的csproj模板中有一个链接文件:

<Compile Include="..\$saferootprojectname$\Shared Files\Mvx$saferootprojectname$.cs">

但是,运行模板时,Visual Studio不会单独保留相对路径,而是替换解压缩的临时文件夹的路径(并随后将其删除!!!)。结果是

>     Error 1   Source file 'C:\Users\tim\AppData\Local\Temp\mi0qfyf2.5lc\Okra\Shared
> Files\MvxOkra.cs' could not be found  \\vmware-host\Shared
> Folders\Documents\Projects\Temp\Plugins\Okra\Okra.Mac\CSC Okra.Mac

因为生成的csproj已经

<Compile Include="C:\Users\tim\AppData\Local\Temp\k4psfgjk.22c\Crab\Shared Files\MvxCrab.cs">
  <Link>MvxCrab.cs</Link>
</Compile>

而不是相对路径。有没有办法解决这个问题而不诉诸巫师?

更新。这可以通过添加&lt; CreateInPlace&gt; true&lt; / CreateInPlace&gt;来解决。进入vstemplate。然后相对路径向右结束。但是,我不想要这个解决方案。我想要允许CreateInPlace为假的解决方案(现在似乎是VS2012中的默认设置),因为我的解决方案在网络共享上,它会触发模板中每个项目的“你想打开”提示符吗是8)。 (即使我说不要问)

enter image description here

也许另一种解决方案是如何让网络共享受信任,这样就不会出现这种提示。

0 个答案:

没有答案