English 中文(简体)
为多种环境制定ClickOnce包
原标题:Build approach for creating ClickOnce packages for multiple environments

我的设想是:

我通过ClickOnce申请了WPF。 申请对多个客户有多种环境(目前为9个,但预计近期将增加一倍)。

目前所使用的程序是(基本):

  • Token replace parts of the app.config
  • Token replace parts of the WiX file used in the generation of the MSI installer (including the signing certificate and thumbprint)
  • Build the solution
  • Create a Client/Environment specific installer
  • Repeat for each client/environment combination

这样做具有意义,即安装应用软件是操作所需安装装置的简单案例。 然而,倒数是,如果(当时)我需要创造新的环境,那么我就必须以一套新的组合参数重新管理整个建筑过程。

我怎么能更好地做到这一点?

我的最新想法是,我分裂了我的建设进程,只是制造两记。 之后,在适当的双筒、配送的汇票、(再)使用MAGE等的签名单上进行单独的包装。

这将继续受益于“一次重建,多次部署”,同时确保如果需要新的环境,可以在不重建双筒的情况下重新包装。

Does this sound like a sensible approach? Does anyone have any guidance for such a scenario?

成就

最佳回答

这同朝着正确方向迈出的一步一样,与我多年来为提出世界森林论坛申请所做的类似,而且它很好地发挥了作用。

我们与监察组城市一道建立解决办法,然后在建立处理ClickOnce出版社的步骤之后,有多个步骤,每个组合的一个步骤。 每个配置都涉及用Mage.exe的MSBuild文档。 它将解决方案产出文件复制到临时名录,然后在申请组等档案中进行多次更换,并管理各种定制的MSBuild任务。

MSBuild项目文件载有基底环境和环境,如ClickOnce下载URL。 我们还不得不在生成的标识本身(然后改用)上做一些黑板的替换,例如将特定档案作为数据标记。

问题回答

我们有类似的情况,在多个环境中使用过WPF ClickOnce应用,这里唯一的东西是连接。

面对以下事实,即你无法在点击包裹中改变组合档案,而没有为每个客户/环境建造一个一揽子建筑工程,我们提出了一个解决办法,让你在服务器部署中安装一个信箱,让申请进入时间。

为此,我们设立了一个静态的班级,最初是“午餐会”活动。

public static class DbConnectionString { public static string ConnectionString { get; private set; iii public static string ActivationPath { get; private set; iii

public static void Init()
{
    string dbContext = "myDbContext";
    string configFile = "App.config";
    ConnectionString = "";
    ActivationPath = "";

    ActivationArguments actArg = AppDomain.CurrentDomain.SetupInformation.ActivationArguments;
    if (actArg != null)
    {
        if (actArg.ActivationData != null)
        {
            try
            {
                var actData = actArg.ActivationData[0];
                var activationPath = Path.GetDirectoryName(new Uri(actData).LocalPath);
                var map = new System.Configuration.ExeConfigurationFileMap();
                map.ExeConfigFilename = Path.Combine(activationPath, configFile);
                var config = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);
                var connectionStringSection = config.ConnectionStrings;
                ConnectionString = connectionStringSection.ConnectionStrings[dbContext].ConnectionString;
                ActivationPath = activationPath;
            iii
            catch (Exception)
            {

                ConnectionString = "";
                ActivationPath = "";
            iii
        iii
    iii
iii

iii

在 Publish/Options/Manifests下的项目环境中,标出“将采用哪些URL参数”

然后,我使用“连接”这一固定类别的财产,在我需要连接时。 除非你仅在线部署该信,否则不会确定该信,因此,我们没有在用于开发/测试的包裹中填写。

它只是一个环绕,但运作良好,而且你只得公布自己的照片,并为每个设施提供一张不改变建筑间的灯塔。

该系统还安装了“财产启动”,这是通往点击服务器安装名录的道路。





相关问题
WPF convert 2d mouse click into 3d space

I have several geometry meshes in my Viewport3D, these have bounds of (w:1800, h:500, d:25). When a user clicks in the middle of the mesh, I want the Point3D of (900, 500, 25)... How can I achieve ...

Editing a xaml icons or images

Is it possible to edit a xaml icons or images in the expression design or using other tools? Is it possible to import a xaml images (that e.g you have exported) in the expression designer for editing?...

WPF: writing smoke tests using ViewModels

I am considering to write smoke tests for our WPF application. The question that I am faced is: should we use UI automation( or some other technology that creates a UI script), or is it good enough to ...

WPF - MVVM - NHibernate Validation

Im facing a bit of an issue when trying to validate a decimal property on domain object which is bound to a textbox on the view through the viewmodel. I am using NHibernate to decorate my property on ...

How do WPF Markup Extensions raise compile errors?

Certain markup extensions raise compile errors. For example StaticExtension (x:Static) raises a compile error if the referenced class cannot be found. Anyone know the mechanism for this? Is it baked ...

WPF design-time context menu

I am trying to create a custom wpf control, I m wondering how I can add some design-time features. I ve googled and can t seem to get to my goal. So here s my simple question, how can I add an entry ...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签