问题描述
VS2015没有任何选项可以在Typescript Cordova项目中添加文件作为链接。如何做?
There is no option on VS2015 to add a file as a link on a Typescript Cordova project. How to do it ?
我试图通过添加以下内容来编辑.jsproj:
I tried to edit the .jsproj by adding this :
<ItemGroup>
<Content Include="..\TypeScriptHTMLApp1\Core\**\*.*">
<Link>Views\Core\%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>false</Visible>
</Content>
</ItemGroup>
但它根本不工作。
目标是拥有此文件层次结构:
The goal is to have this file hierarchy :
- 打字HTML核心文件
- (使用Core文件)
- Cordova项目(使用Core文件)
C#web项目,没关系。但对于cordova项目,不能添加我的核心文件作为链接...
For the C# web project, it's ok. But for the cordova project, can't add my core files as a link...
我该怎么做呢?
感谢
How I can do that ?Thanks
编辑:我找到了一个解决方法:
I have found a workaround :
把这个放在.jsproj
Put this on the .jsproj
<!-- On build, we copy all core front end files -->
<Target Name="CopyContentFiles" BeforeTargets="Build">
<ItemGroup>
<FilesToCopy Include="path to your shared folder on the core project\**\*.*" />
</ItemGroup>
<Copy SourceFiles="@(FilesToCopy)"
DestinationFiles="@(FilesToCopy->'path to your shared folder on the destination project (cordova project), for eg: www\core\%(RecursiveDir)%(Filename)%(Extension)')"
SkipUnchangedFiles="True" />
</Target>
推荐答案
我在Visual Studio中使用Apache Cordova工具在Microsoft。
I work on the Tools for Apache Cordova in Visual Studio at Microsoft.
不幸的是,Cordova项目系统不支持添加为链接。为了防止混淆,我们删除了更新3中的选项。
Unfortunately, the Cordova project system does not support add as link. To prevent confusion, we removed the option in update 3.
目前没有很好的解决方法。最好的解决方案是将文件从一个项目复制到另一个项目。我知道这是一种痛苦。我们正在讨论解决方案,以便在将来能够更轻松地共享代码,但目前我们没有一个好的答案。
There is no good workaround at the moment. The best solution is to copy files from one project into the other. I know this is a pain. We are discussing solutions that will enable easier code sharing in the future, but at the moment we don't have a good answer for you.
感谢您的宝贵意见。
这篇关于VS2015打字稿cordova添加为链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!