How to create multiple executable file/uwp app by using one project?
如何使用一个项目创建多个可执行文件/ uwp应用程序?
I have a program which have two version, one is Full Version, one is Lite Version.
我有一个程序有两个版本,一个是完整版,一个是精简版。
But I have only one Project which contain all the code, the only different of full and lite can be adjust in my config, when the config changed, it will turn into lite version with less feature. I need to produce full.exe and lite.exe using only one code based (one project)
但我只有一个包含所有代码的项目,唯一不同的full和lite可以在我的配置中调整,当配置改变时,它将变成具有较少功能的lite版本。我只需要使用一个代码(一个项目)生成full.exe和lite.exe
full.exe
config file will have "full=1".
lite.exe
config file will not contain this info.
Same for UWP, How to make two app using only one UWP project?
对于UWP,如何仅使用一个UWP项目制作两个应用程序?
1 个解决方案
#1
0
You can use Conditional Compilation and Preprocessor Directives.
First open Build/Configuration Manager and add new configuration. Call it "Full" In project properties in Build tab choose this configuration and add to conditional configuration symbols some word. Wor example "Full".
Now you can wrap code that is used in light or in full versions:
您可以使用条件编译和预处理器指令。首先打开Build / Configuration Manager并添加新配置。将其命名为“Full”在Build选项卡的项目属性中选择此配置并向条件配置符号添加一些单词。 Wor示例“完整”。现在,您可以包装在light或完整版本中使用的代码:
#If FULL
// Insert code to be compiled for full version
#End If
update:
If you need trial versions you can use LicenseInformation class and ProductLicenses. Nice article about it:
Test In-App Purchases in Windows Universal Apps (UWP)
更新:如果您需要试用版,可以使用LicenseInformation类和ProductLicenses。关于它的好文章:在Windows通用应用程序(UWP)中测试应用程序内购买
#1
0
You can use Conditional Compilation and Preprocessor Directives.
First open Build/Configuration Manager and add new configuration. Call it "Full" In project properties in Build tab choose this configuration and add to conditional configuration symbols some word. Wor example "Full".
Now you can wrap code that is used in light or in full versions:
您可以使用条件编译和预处理器指令。首先打开Build / Configuration Manager并添加新配置。将其命名为“Full”在Build选项卡的项目属性中选择此配置并向条件配置符号添加一些单词。 Wor示例“完整”。现在,您可以包装在light或完整版本中使用的代码:
#If FULL
// Insert code to be compiled for full version
#End If
update:
If you need trial versions you can use LicenseInformation class and ProductLicenses. Nice article about it:
Test In-App Purchases in Windows Universal Apps (UWP)
更新:如果您需要试用版,可以使用LicenseInformation类和ProductLicenses。关于它的好文章:在Windows通用应用程序(UWP)中测试应用程序内购买