简体   繁体   English

单击一次部署 - 如何发布具有多个VS项目的应用程序?

[英]Click Once Deployment - How to publish an application which has multiple VS projects?

I'm building a complex WPF application. 我正在构建一个复杂的WPF应用程序。 I'm having multiple visual studio solutions. 我有多个visual studio解决方案。 Each solution has a project. 每个解决方案都有一个项目 Due to code protection reason, I had to place projects in separate solutions. 由于代码保护的原因,我不得不将项目放在单独的解决方案中。

  1. ComponentMain Solution (WPF Application) ComponentMain解决方案(WPF应用程序)
  2. ComponentA Solution (Class Library) ComponentA解决方案(类库)
  3. ComponentB Solution (Class Library) ComponentB解决方案(类库)

Component A & B referenses assembly of Main Solution. 组件A和B参考主要解决方案的组装。 The main solution loads the assemblies of Component A & B using reflection during the runtime. 主要解决方案在运行时使用反射加载组件A和B的组件。

When I build each solution, an Xcopy post build event will be triggered and all the dll's are copied into a folder called GlobalOutput, where I can run the application by simply running the MainSolution.exe. 当我构建每个解决方案时,将触发Xcopy post build事件并将所有dll复制到名为GlobalOutput的文件夹中,我可以通过运行MainSolution.exe来运行应用程序。

Now I want to publish the application using ClickOnce. 现在我想使用ClickOnce发布应用程序。 As I mentioned earlier, there are multiple projects and Dll's are loaded using reflection. 正如我之前提到的,有多个项目,并且使用反射加载Dll。

As per to my knowledge I cannot use the click once publish wizard due to above reason. 据我所知,由于上述原因,我无法使用Click once publish向导。 May be i'm wrong. 也许我错了。

How can I publish my application using click once.? 如何使用Click一次发布我的应用程序。 As I haveing all the dll's in GlobalOutput directory, Is there any way to create clickkonce deployment directly from there? 当我在GlobalOutput目录中拥有所有dll时,有没有办法直接从那里创建clickkonce部署?

You can try to specify which files are published by Click Once. 您可以尝试指定Click Once发布的文件。

For you, it will be something like: 对你而言,它将是这样的:

  • Pick one of those solutions/projects as the publishing project to configure Click Once. 选择其中一个解决方案/项目作为发布项目来配置Click Once。 You need to mark the dlls from the other projects/solutions as prerequisites. 您需要将其他项目/解决方案中的dll标记为先决条件。
    1. With a project selected in Solution Explorer, on the Project menu, click Properties. 在解决方案资源管理器中选择项目后,在“项目”菜单上单击“属性”。
    2. Click the Publish tab. 单击“发布”选项卡。
    3. Click the Application Files button to open the Application Files dialog box. 单击“应用程序文件”按钮以打开“应用程序文件”对话框
    4. In the Application Files dialog box, select the application assembly (.dll file) that you wish to mark as a prerequisite. 在“应用程序文件”对话框中,选择要标记为先决条件的应用程序程序集(.dll文件)。 Note that your application must have a reference to the application assembly in order for it to appear in the list. 请注意,您的应用程序必须具有对应用程序程序集的引用,才能使其显示在列表中。
    5. In the Publish Status field, select Prerequisite from the drop-down list. 在“发布状态”字段中,从下拉列表中选择“先决条件”。

To make the file from the other solutions/projects appear in the Application File Dialog box in step 3, you can either reference the output dlls, or add them as solution file and set the build action to content. 要使其他解决方案/项目中的文件显示在步骤3的“应用程序文件”对话框中,您可以引用输出dll,也可以将它们添加为解决方案文件,并将构建操作设置为内容。

For more information: Specify Which Files Are Published by ClickOnce 有关更多信息: 指定ClickOnce发布的文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM