Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Custom msbuild targets and ClickOnce
 

Custom msbuild targets and ClickOnce

Hello,

I have a set of custom msbuild targets that I import into my project to build custom files that belong to my application. Theadditional outputs areessentially binary resource files. How do I get the ClickOnce targets to recognize these additional files as items to be published? Is there a specific item group I can add them to?

Stephen Styrchak  Monday, October 22, 2007 5:22 AM

Hi, Stephen,

Based on my understanding, you want to know how to add the resource generated byMSBuid to a ClickOnce deployment, don't you?

In my point of view, you can just build your project, and add the generated files into your project through solution explorer.

And then you should be able to add them into your ClickOnce deployment in the ClickOnce publish page.

If that doen't work, you could use Mage tool in your Visual Studio.

Here is a tutorial.

http://msdn2.microsoft.com/en-us/library/xc3tc5xx.aspx

Hope this helps,

Regards

Yu Guo â€?MSFT  Wednesday, October 24, 2007 8:59 AM

Hi, Stephen,

Based on my understanding, you want to know how to add the resource generated byMSBuid to a ClickOnce deployment, don't you?

In my point of view, you can just build your project, and add the generated files into your project through solution explorer.

And then you should be able to add them into your ClickOnce deployment in the ClickOnce publish page.

If that doen't work, you could use Mage tool in your Visual Studio.

Here is a tutorial.

http://msdn2.microsoft.com/en-us/library/xc3tc5xx.aspx

Hope this helps,

Regards

Yu Guo â€?MSFT  Wednesday, October 24, 2007 8:59 AM

That's the end result I want, but I need it to be automatic.

My project uses custom targets to build files other than assemblies. You could think of them like satellite resource files -- they don't contain code, but they are binary files that are required by my application.

As an example, let's imagine a very simple case where I might have a target like this:

<Target Name="BuildCustomFileFoo">

<WriteLinesToFile

File="Foo.abc"

Lines="@(SomeDataFromVariousInputFiles)"

Overwrite="true"/>

</Target>

This file (Foo.abc) is built by my project, and I want to deploy it when I deploy my application. I don't want to add the file to my project because my project could be under source code control, and having build outputs in SCC is never a good idea. Also, I would have to do this for every file that I generate, and there may be thousands of them for my project type. I would also need to keep them in sync when I changed the name of the input files, etc.

What I would like to know is how to tell the Publish target that it should include "Foo.abc" in the application manifest when it builds the application manifest, and also to display Foo.abc the IDE when the user clicks on the Application Files... button on the Publish page. I'm certain that I can do this through msbuild, but the Publish targets are undocumented.

I got some pointers today from Dave Templin (who wrote a bunch of the original ClickOnce msbuild tasks), and I think I understand what to do now. I'll post back if I get it working.

Thanks,

--Stephen

Stephen Styrchak  Thursday, October 25, 2007 11:54 PM

Hi, Stephen,

I hope I knew all the details in your original post...

I think you can try to write your own Target segment to publish the project, and you can copy and move files there, butI don't think you can include the custom output files into your project while publishing. Because the files for publishing should be pre-defined in your project file.

So, I do recommend you to use Mage tool to solve your problem.It is easy to use and could save you a lot of time to write the Target segment.

But if you find some way to publish you project as you expected, you are welcomed to share it here.

And all the community members could benefit from that.

Regards

Yu Guo â€?MSFT  Friday, October 26, 2007 3:55 AM

You can use google to search for other answers

Custom Search

More Threads

• ClickOnce - Installation for different users on same machine
• Sudden failure of Click-Once deployment
• AxSHDocVw.AxWebBrowser
• Uninstall failed, can't reinstall / upgrade either
• Uninstalling MSI's Installed as user
• 2 exe's
• Two Installers into One
• Checking for DLL before installing
• Prerequisite directory for net 2.0
• Conditions on Folder