Phonegap Build与Visual Studio中config.xml的位置

时间:2022-03-31 07:30:26

Visual Studio 2015 requires config.xml to be placed in the root folder of a project.

Visual Studio 2015要求将config.xml放在项目的根文件夹中。

Phonegap Build requires that config.xml is placed inside the www folder.

Phonegap Build要求将config.xml放在www文件夹中。

Neither of the two seem to accept the other location of config.xml. How am I able to build using both Visual Studio and Phonegap Build without manually modifying the location of config.xml?

这两者似乎都没有接受config.xml的其他位置。如何在不手动修改config.xml位置的情况下使用Visual Studio和Phonegap Build构建?

1 个解决方案

#1


A solution is to copy the config.xml from one location to the other when building.

解决方案是在构建时将config.xml从一个位置复制到另一个位置。

This can be done in Visual Studio by editing the .jsproj file and inserting the following MSBuild target:

这可以通过编辑.jsproj文件并插入以下MSBuild目标在Visual Studio中完成:

<Target Name="AfterBuild">
    <Copy SourceFiles="config.xml" DestinationFolder="www" ContinueOnError="false" />
</Target>

#1


A solution is to copy the config.xml from one location to the other when building.

解决方案是在构建时将config.xml从一个位置复制到另一个位置。

This can be done in Visual Studio by editing the .jsproj file and inserting the following MSBuild target:

这可以通过编辑.jsproj文件并插入以下MSBuild目标在Visual Studio中完成:

<Target Name="AfterBuild">
    <Copy SourceFiles="config.xml" DestinationFolder="www" ContinueOnError="false" />
</Target>