<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Office Development with Visual Studio : Saurabh Bhatia</title><link>http://blogs.msdn.com/vsto/archive/tags/Saurabh+Bhatia/default.aspx</link><description>Tags: Saurabh Bhatia</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Visual Studio 2010: Specify advanced publishing options (Saurabh Bhatia)</title><link>http://blogs.msdn.com/vsto/archive/2009/10/19/visual-studio-2010-specify-advanced-publishing-options-saurabh-bhatia.aspx</link><pubDate>Mon, 19 Oct 2009 22:31:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9909491</guid><dc:creator>VSTO Team</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/vsto/comments/9909491.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vsto/commentrss.aspx?PostID=9909491</wfw:commentRss><description>&lt;p&gt;I have previously &lt;a href="http://blogs.msdn.com/vsto/archive/2008/06/11/specify-a-product-name-publisher-name-and-other-properties-for-vsto-solutions-saurabh-bhatia.aspx"&gt;posted&lt;/a&gt; how you can specify various properties for a VSTO solution like the Publisher and Product Names by tweaking a few files in Visual Studio 2008.&lt;/p&gt;  &lt;p&gt;With Visual Studio 2010 (&lt;a href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx"&gt;Beta 2&lt;/a&gt;) you can edit these properties directly through the Publish Page. All Office projects in Visual Studio 2010 now have an &lt;strong&gt;Options&lt;/strong&gt; button on the Publish Page, which allows you to spet these properties.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/VisualStudio2010Beta2Specifyadvancedpubl_128C7/image_2.png"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/VisualStudio2010Beta2Specifyadvancedpubl_128C7/image_thumb.png" width="555" height="387" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The Publish Options dialog is similar to the ClickOnce publish options dialog for other types of projects, but this dialog only displays the options applicable to Office projects.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/VisualStudio2010Beta2Specifyadvancedpubl_128C7/image_4.png"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/VisualStudio2010Beta2Specifyadvancedpubl_128C7/image_thumb_1.png" width="591" height="337" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Here is what these properties mean:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Publisher Name&lt;/b&gt; – The name of the Publisher as displayed in Programs and Features&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Product Name&lt;/b&gt; – The name of the Solution as it will show up in the Programs and Features (Add Remove Programs Entry)&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Support URL&lt;/b&gt; – A URL which End Users can visit to get support for this particular solution. The support URL shows up as a clickable link for the product name during the installation trust prompt.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/VisualStudio2010Beta2Specifyadvancedpubl_128C7/image_6.png"&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/VisualStudio2010Beta2Specifyadvancedpubl_128C7/image_thumb_2.png" width="591" height="338" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Solution Name&lt;/b&gt; – (Friendly Name) This is the name of the Add-In as it is displayed in the Office Add-ins dialog. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Office Application Description&lt;/b&gt; – The description of the Office Add-in as displayed in the Office Add-ins dialog.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Add-in Load Behavior – &lt;/strong&gt;Specifies whether the add-in should load when the Office Application Starts up or whether it should load on demand when the end user tries to interact with it. By default all add-ins are set to load at startup of the Office Application but if you care about Office startup performance and don’t want your add-in to be running all the time then you should consider loading it on demand.&lt;/p&gt;  &lt;p&gt;Andrew Whitechapel has a &lt;a href="http://blogs.msdn.com/andreww/archive/2008/07/14/demand-loading-vsto-add-ins.aspx"&gt;post&lt;/a&gt; on how an Office add-in can be demand loaded using different loadbehavior values. Previously you had manually update the ClickOnce manifests with the appropriate load behavior value. With Visual Studio 2010 you can set the option to load the add-in on demand and the loadbehavior will be automatically set to 16 (&lt;a href="http://blogs.msdn.com/andreww/archive/2008/04/19/delay-loading-the-clr-in-office-add-ins.aspx"&gt;connect first time&lt;/a&gt;) –&amp;gt; Load the add-in on startup for the first time and then load on demand from then on.&lt;/p&gt;  &lt;p&gt;Loading an add-in on demand can help improve the startup performance of the Office application. It can also reduce the application’s working set as the add-in is not loaded in memory until the end user interacts with it. Setting the add-in to demand load is a good option if your add-in has UI based triggers, like a Ribbon item that the end user can interact with to load the add-in. However demand loading may not be a good option if your add-in is needs to listen to application events like opening a document etc all the time the application is running. So if your add-in doesn’t have to run all the time, then setting it to Load on Demand is a good option to consider. &lt;/p&gt;  &lt;p&gt;Lastly, there is an interesting side note for those of you who may have changed their VS 2008 based project files based on my previous post. If you updated the project file using the same property names as that mentioned in the post, you can migrate that project to VS 2010 and continue using those property values. You no longer need the custom targets file as that functionality is now directly available in the Visual Studio common targets.&lt;/p&gt;  &lt;p&gt;For more information, see &lt;a href="http://msdn.microsoft.com/en-us/library/bb608591(VS.100).aspx"&gt;Publishing Office Solutions&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Have fun with &lt;a href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx"&gt;Visual Studio 2010 Beta2&lt;/a&gt; and let us know your &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/category/VSPreRelease,netdevelopmentprerelease,visualstudioprerelease,vstsprerelease"&gt;feedback&lt;/a&gt;!&lt;/p&gt;  &lt;p&gt;Saurabh &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9909491" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vsto/archive/tags/ClickOnce/default.aspx">ClickOnce</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Deployment/default.aspx">Deployment</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Manifest/default.aspx">Manifest</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Saurabh+Bhatia/default.aspx">Saurabh Bhatia</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Publisher+Name/default.aspx">Publisher Name</category><category domain="http://blogs.msdn.com/vsto/archive/tags/SupportUrl/default.aspx">SupportUrl</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Product+Name/default.aspx">Product Name</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Add+Remove+Programs/default.aspx">Add Remove Programs</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+Addin+Properties/default.aspx">Office Addin Properties</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Programs+and+Features/default.aspx">Programs and Features</category><category domain="http://blogs.msdn.com/vsto/archive/tags/add-ins/default.aspx">add-ins</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Visual+Studio+2010/default.aspx">Visual Studio 2010</category></item><item><title>Issues with installing VSTO projects that were published from Visual Studio 2008 on Windows 7 RC (Saurabh Bhatia)</title><link>http://blogs.msdn.com/vsto/archive/2009/05/07/issues-with-installing-vsto-projects-that-were-published-from-visual-studio-2008-on-windows-7-rc-saurabh-bhatia.aspx</link><pubDate>Thu, 07 May 2009 23:32:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9594863</guid><dc:creator>VSTO Team</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/vsto/comments/9594863.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vsto/commentrss.aspx?PostID=9594863</wfw:commentRss><description>&lt;P&gt;Many customers have reported issues with installing a VSTO project that has been published with Visual Studio 2008 running on the recently released Windows 7 Release Candidate.&lt;/P&gt;
&lt;P&gt;If you published your solution using VS2008 on a machine running the Windows 7 RC and then you try to install the solution on any machine you will see the following error: “The required version of the .NET Framework is not installed on this computer”&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/IssueswithinstallingVSTOprojectsthatwere_BE50/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/IssueswithinstallingVSTOprojectsthatwere_BE50/image_2.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/IssueswithinstallingVSTOprojectsthatwere_BE50/image_thumb.png" width=421 height=480 mce_src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/IssueswithinstallingVSTOprojectsthatwere_BE50/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;You will see this error even if you have the right version of .Net Framework installed. The issue occurs due to some differences in the publishing mechanism on the Windows 7 RC caused by a missing file in the .Net Framework 3.5.1 which was included in the RC.&lt;/P&gt;
&lt;P&gt;The following file is missing:&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3 face=Consolas&gt;%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5\RedistList\FrameworkList.xml&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;You can workaround the issue by manually copying this file from an existing non Windows 7 machine which has the .Net Framework 3.5 installed. The file will be available at the exact same location.&lt;/P&gt;
&lt;P&gt;Once you have included this file on the Windows 7 RC machine, you will be able to publish and generate the correct manifests. After making this change please republish any solutions that were previously published from the Windows 7 RC machine. These solutions will now be able to install successfully.&lt;/P&gt;
&lt;P&gt;We are tracking this issue and plan to address it before Windows 7 RTM. If you are using the RC release please use the workaround mentioned above.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Updates**********&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If you have having trouble replacing the file. You need to be an Owner of the file and your user account needs Full Control.&amp;nbsp; To do this: &lt;/P&gt;
&lt;P&gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp; Right click the File -&amp;gt; Properties &lt;BR&gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp; Select Security Tab &lt;BR&gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp; Click the Advanced Button &lt;BR&gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp; Click the “Owner” Tab &lt;BR&gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp; Click the Change Button &lt;BR&gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp; Double Click your User Object &lt;BR&gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp; Click Okay &lt;BR&gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp; Click Okay, &lt;BR&gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp; Ensure you have “Full Control” Permissions to the file by repeating steps above and adding your user account with Full Control permissions. &lt;/P&gt;
&lt;P&gt;Also if you are on a 64 bit system:&lt;/P&gt;
&lt;P&gt;Note that you need to replace both the architecture specific files on a 64bit bit OS, i.e. &lt;BR&gt;[Program Files x86]\Reference Assemblies\Microsoft\Framework\v3.5\RedistList &lt;BR&gt;%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.5\RedistList&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9594863" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vsto/archive/tags/ClickOnce/default.aspx">ClickOnce</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Deployment/default.aspx">Deployment</category><category domain="http://blogs.msdn.com/vsto/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Saurabh+Bhatia/default.aspx">Saurabh Bhatia</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Windows+7+RC/default.aspx">Windows 7 RC</category></item><item><title>Signing and re-signing manifests in ClickOnce (Saurabh Bhatia)</title><link>http://blogs.msdn.com/vsto/archive/2009/04/29/signing-and-re-signing-manifests-in-clickonce.aspx</link><pubDate>Thu, 30 Apr 2009 04:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9577695</guid><dc:creator>VSTO Team</dc:creator><slash:comments>11</slash:comments><comments>http://blogs.msdn.com/vsto/comments/9577695.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vsto/commentrss.aspx?PostID=9577695</wfw:commentRss><description>&lt;P&gt;ClickOnce manifest &lt;A&gt;signing &lt;/A&gt;can be a little confusing for someone going through the process the very first time. This is probably because it involves signing multiple files in a particular sequence. Once you understand the process conceptually it becomes fairly easy to follow. In this post, I hope to provide a &lt;A&gt;quick summary of the important things&lt;/A&gt;you need to know about manifests and this signing/resigning business.&lt;/P&gt;
&lt;P&gt;Let’s start with some background info in case you missed it:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;What are these manifests I speak of?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Any application deployed through ClickOnce will have two manifests: a deployment manifest and an application manifest. &lt;/P&gt;
&lt;P&gt;Depending on the type of application, the &lt;STRONG&gt;deployment manifest&lt;/STRONG&gt; can have the following file extensions:&lt;/P&gt;
&lt;P&gt;.application – for any executable application like a Winforms or WPF application&lt;/P&gt;
&lt;P&gt;.vsto – for a VSTO based Office customization solutions (which this blog is all about)&lt;/P&gt;
&lt;P&gt;.&lt;A&gt;xbap &lt;/A&gt;– for a Browser Hosted WPF application&lt;/P&gt;
&lt;P&gt;An &lt;STRONG&gt;application manifest&lt;/STRONG&gt; will always have the .manifest extension. For example:&lt;/P&gt;
&lt;P&gt;.exe.manifest – for any executable including Winforms, WPF and Browser Hosted WPF applications.&lt;/P&gt;
&lt;P&gt;.dll.manifest – for VSTO based office customizations.&lt;/P&gt;
&lt;P&gt;MSDN has documentation that describes these files and their use in detail but for a one line summary – think of these as “Setup Authoring” for your application that tells the application how to install, update, what the application is called etc.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/ws1c2fch.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ws1c2fch.aspx"&gt;ClickOnce Application Manifest&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/k26e96zf.aspx" mce_href="http://msdn.microsoft.com/en-us/library/k26e96zf.aspx"&gt;ClickOnce Deployment Manifest&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/bb757477.aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb757477.aspx"&gt;Application Manifests for Office Solutions (2007 System)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;So why do manifests have to be signed?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;The ClickOnce “trust model” is based on signing the ClickOnce manifests with a Certificate. By “trust model,” I mean the process by which ClickOnce and the end user can decide whether to trust an application and allow it to install or not. To sign an application, you need a Certificate - Visual Studio will generate a temporary certificate for you when you publish an application (like MyApplication_Temporary.pfx) and also sign the manifests for you. You can also choose to sign the manifests with a code-signing certificate that you can obtain from a Root Certificate Authority.&lt;/P&gt;
&lt;P&gt;These MSDN articles go into details about the certificates and how they are used:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/ms172240.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms172240.aspx"&gt;ClickOnce Deployment and Authenticode&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/zfz60ccf.aspx" mce_href="http://msdn.microsoft.com/en-us/library/zfz60ccf.aspx"&gt;Signing ClickOnce Manifests&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Starting with .NET 3.5 SP1, signing has become optional for any .exe-based application. So Winforms/WPF/Console applications deployed via Clickonce no longer need to be signed. The downside of course is that there are no guarantees on the integrity of the application. The developer has to make the choice between the tradeoff of securing the application and going through the signing process vs not signing the application at all and relying on some other means of ensuring the application has not being compromised.&lt;/P&gt;
&lt;P&gt;Note that VSTO solutions still require that the manifests be signed. Most VSTO scenarios are in the enterprise where best practices require signing of applications. Also since VSTO solutions always run full trust there is a higher risk associated with making signing optional. &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Why do they need to be re-signed?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Visual Studio is capable of generating signed manifests. Why get into this whole re-signing business? Re-signing is needed when you are in a situation where you want to change something about the application after it has already been published – and you want to do so without re-building or re-publishing the application from Visual Studio.&amp;nbsp; You may want to simply sign the application with a different certificate without re-building the application, for example you test the application with a self created test certificate but when you deploy the application to end users it is signed with a code-signing certificate issued by a Certificate Authority. Some of the most common examples that re-quire re-signing are when you want to change a particular file that is part of your application like the .config file, or maybe a simple resource/data file that is deployed along with your application.&lt;/P&gt;
&lt;P&gt;The ClickOnce manifests contain hashes to all the files that are being deployed as part of the application. If any of the files change, then the hash for that file breaks and the signing becomes invalid. So you cannot simply replace an individual file in a ClickOnce package without breaking the signing. You will have to update and re-sign the manifests if you want to update a file.&lt;/P&gt;
&lt;P&gt;The following figures should help illustrate this better.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/ResigningClickOncemanifests101_AC30/clip_image002_2.gif" mce_href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/ResigningClickOncemanifests101_AC30/clip_image002_2.gif"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=clip_image002 border=0 alt=clip_image002 src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/ResigningClickOncemanifests101_AC30/clip_image002_thumb.gif" width=529 height=167 mce_src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/ResigningClickOncemanifests101_AC30/clip_image002_thumb.gif"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;A typical ClickOnce deployment package consists of &lt;/P&gt;
&lt;P&gt;· &lt;A&gt;Deployment Manifest&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;· Application Manifest&lt;/P&gt;
&lt;P&gt;· Application Files – the exe and dlls associated with the application. &lt;/P&gt;
&lt;P&gt;The deployment manifest links to the application manifest along with the hash of the application manifest, so if the application manifest changes the hash will no longer be valid. Similarly the Application manifest links to all the application files along with their hashes.&lt;/P&gt;
&lt;P&gt;So consider the situation where one of the application files say the .config file in this case changes after the app has been published. &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/controlpanel/AppData/Local/Temp/WindowsLiveWriter736622988/supfiles1925C2D5/image19.png" mce_href="../AppData/Local/Temp/WindowsLiveWriter736622988/supfiles1925C2D5/image19.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=clip_image004 border=0 alt=clip_image004 src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/ResigningClickOncemanifests101_AC30/clip_image004_65741ff0-a0d7-499e-8dd4-a5a858b61bf4.gif" width=529 height=167 mce_src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/ResigningClickOncemanifests101_AC30/clip_image004_65741ff0-a0d7-499e-8dd4-a5a858b61bf4.gif"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Since the .config file changed the hash in the Application Manifest will not match up to the new file anymore. Trying to install the application in this state will fail (unless you are using optional signing and hashing of course). &lt;/P&gt;
&lt;P&gt;You will have to update and re-sign the application manifest in order to get the deployment to work again.&lt;/P&gt;
&lt;P&gt;You can do this using the following mage commandline:&lt;/P&gt;
&lt;P&gt;Start the Visual Studio command prompt. Locate the application manifest folder. Typically under “%Publish Folder%\Application Files\MyApplication_Version\Myapplication.exe.manifest”&lt;/P&gt;
&lt;P&gt;Use the &lt;A&gt;–update&lt;/A&gt; option for the mage command line.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size=3 face=Consolas&gt;&amp;gt; mage –update Myapplication.exe.manifest –certfile mycert.pfx&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The update command will update all the file hashes defined in the application manifest to match those of the files located next to it. For other options on how to use update see MSDN: &lt;A href="http://msdn.microsoft.com/en-us/library/acz3y3te.aspx" mce_href="http://msdn.microsoft.com/en-us/library/acz3y3te.aspx"&gt;Manifest Generation and Editing Tool (Mage)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Note: While update the application, you might see some errors about Files not found. This could happen if you using the .deploy extensions for you application files. To avoid this, you must rename the .deploy extensions back to their original extensions and then run the update command with mage. Once you have update the application manifest, you must rename the application files back with he .deploy extension.&lt;/P&gt;
&lt;P&gt;Once you have updated the application manifest with mage, all the files it refers to will have the correct hashes. However at this point since the application manifest itself is updated, the hash to the application manifest contained within the deployment manifest will no longer match.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/controlpanel/AppData/Local/Temp/WindowsLiveWriter736622988/supfiles1925C2D5/image26.png" mce_href="../AppData/Local/Temp/WindowsLiveWriter736622988/supfiles1925C2D5/image26.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=clip_image006 border=0 alt=clip_image006 src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/ResigningClickOncemanifests101_AC30/clip_image006_05d1e115-155e-4b0c-8701-ae598a169596.gif" width=529 height=167 mce_src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/ResigningClickOncemanifests101_AC30/clip_image006_05d1e115-155e-4b0c-8701-ae598a169596.gif"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;To fix this the deployment manifest needs to be updated with the hash of the new application manifest and re-signed.&lt;/P&gt;
&lt;P&gt;The mage command line to do this:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size=3 face=Consolas&gt;&amp;gt; mage.exe –update Myapplication.application –appmanifest “Application Files\MyApplication_%Version%\Myapplication.exe.manifest” –certfile mycert.pfx&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size=3 face=Consolas&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/controlpanel/AppData/Local/Temp/WindowsLiveWriter736622988/supfiles1925C2D5/image32.png" mce_href="../AppData/Local/Temp/WindowsLiveWriter736622988/supfiles1925C2D5/image32.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=clip_image008 border=0 alt=clip_image008 src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/ResigningClickOncemanifests101_AC30/clip_image008_b96bfa0c-f411-459e-b9de-e0eb00c574e0.gif" width=529 height=167 mce_src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/ResigningClickOncemanifests101_AC30/clip_image008_b96bfa0c-f411-459e-b9de-e0eb00c574e0.gif"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;At this point, all the hashes to all the files have been updated and both manifests &lt;A&gt;have been &lt;/A&gt;re-signed. So the application is ready to be installed on the end users’ machine&lt;A&gt; without re-building or re-publishing from Visual Studio&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;In the above example I chose to show how the resigning process is done through the Mage command line tool. The same process can be done through the &lt;A href="http://msdn.microsoft.com/en-us/library/xhctdw55.aspx" mce_href="http://msdn.microsoft.com/en-us/library/xhctdw55.aspx"&gt;MAGEUI&lt;/A&gt; tool which provides a GUI for the manifest editing. For simply re-signing your manifests I have always preferred to use the command line. The re-signing process itself can be straightforward once you understand the need for it. Most users forget to either update or sign both manifests and I hope this post illustrates the chaining dependency and why both manifests need to be updated.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9577695" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vsto/archive/tags/ClickOnce/default.aspx">ClickOnce</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Deployment/default.aspx">Deployment</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Manifest/default.aspx">Manifest</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Saurabh+Bhatia/default.aspx">Saurabh Bhatia</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Mage/default.aspx">Mage</category></item><item><title>Channel 9 Interview: Resigning ClickOnce Application and Deployment Manifests with MAGE (Beth Massi, Saurabh Bhatia)</title><link>http://blogs.msdn.com/vsto/archive/2009/04/08/channel-9-interview-resigning-clickonce-application-and-deployment-manifests-with-mage-beth-massi-saurabh-bhatia.aspx</link><pubDate>Wed, 08 Apr 2009 18:25:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9538393</guid><dc:creator>VSTO Team</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/vsto/comments/9538393.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vsto/commentrss.aspx?PostID=9538393</wfw:commentRss><description>&lt;p&gt;&lt;a href="http://channel9.msdn.com/posts/funkyonex/Resigning-ClickOnce-Application-and-Deployment-Manifests-with-MAGE/" target="_blank"&gt;I just posted another interview on Channel 9&lt;/a&gt;. I sit down again with Saurabh Bhatia, a Program Manager on the Office Client team, who is responsible for the ClickOnce publishing functionality in Visual Studio. We chat about trust issues and certificates and he sets me straight on how ClickOnce deployment and application manifests work. He then shows how to resign them outside of Visual Studio using a tool called &lt;a href="http://msdn.microsoft.com/en-us/library/acz3y3te.aspx"&gt;Mage&lt;/a&gt;. This is really handy for folks that need to modify the files within a deployment package, like the application settings (app.config) file, but don't have Visual Studio installed. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://channel9.msdn.com/posts/funkyonex/Resigning-ClickOnce-Application-and-Deployment-Manifests-with-MAGE/"&gt;&lt;strong&gt;Channel 9: Resigning ClickOnce Application and Deployment Manifests with MAGE&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Saurabh draws on the whiteboard in this one and since I'm a one (wo)man show I couldn't jump up and zoom in so I redrew it for you all here. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/photos/bethmassi/images/9537238/original.aspx"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://blogs.msdn.com/photos/bethmassi/images/9537238/500x177.aspx" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Links from the show:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/acz3y3te.aspx"&gt;Mage&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/vsto"&gt;Office Client (VSTO) Team blog (you are here ;-))&lt;/a&gt;      &lt;li&gt;&lt;/li&gt;     &lt;a href="http://msdn.com/vsto"&gt;VSTO Developer Center&lt;/a&gt; &lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Enjoy,   &lt;br /&gt;-&lt;a href="http://blogs.msdn.com/bethmassi"&gt;Beth Massi&lt;/a&gt;, Visual Studio Community&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9538393" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vsto/archive/tags/ClickOnce/default.aspx">ClickOnce</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Deployment/default.aspx">Deployment</category><category domain="http://blogs.msdn.com/vsto/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Saurabh+Bhatia/default.aspx">Saurabh Bhatia</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Beth+Massi/default.aspx">Beth Massi</category></item><item><title>Specifying a Product Name, Publisher Name and other properties for VSTO solutions (Saurabh Bhatia)</title><link>http://blogs.msdn.com/vsto/archive/2008/06/11/specify-a-product-name-publisher-name-and-other-properties-for-vsto-solutions-saurabh-bhatia.aspx</link><pubDate>Thu, 12 Jun 2008 02:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8592351</guid><dc:creator>VSTO Team</dc:creator><slash:comments>13</slash:comments><comments>http://blogs.msdn.com/vsto/comments/8592351.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vsto/commentrss.aspx?PostID=8592351</wfw:commentRss><description>&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many customers have requested how to specify options like a Product or Publisher Name for Office 2007 VSTO solutions deployed from Visual Studio 2008. However, you cannot specify these properties in the Visual Studio IDE. In this post, I will describe the various other options you have to specify these properties.&lt;/P&gt;
&lt;P&gt;Specifically we will be looking at the following properties:&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Product Name&lt;/B&gt; – This is what the VSTO solution will be called in the Programs and Features (Add Remove Programs Entry)&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Publisher Name&lt;/B&gt; – The name of the Publisher as displayed in Programs and Features&lt;/P&gt;
&lt;P align=center&gt;&lt;A href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/SpecifyaProductNamePublisherNameandother_E202/clip_image002%5B11%5D.jpg" mce_href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/SpecifyaProductNamePublisherNameandother_E202/clip_image002%5B11%5D.jpg"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=161 alt=clip_image002[11] src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/SpecifyaProductNamePublisherNameandother_E202/clip_image002%5B11%5D_thumb.jpg" width=604 border=0 mce_src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/SpecifyaProductNamePublisherNameandother_E202/clip_image002%5B11%5D_thumb.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P align=center&gt;Figure 1 : Programs and Features Dialog in Vista showing Product Name and Publisher Name&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Friendly Name&lt;/B&gt; – This is the name of the VSTO solution as it is displayed in the Office Add-ins dialog, the same value is also used in the VSTO trust prompt. Usually this value should be the same as the Product Name. &lt;/P&gt;
&lt;P&gt;&lt;B&gt;Office Application Description&lt;/B&gt; – The description of the Office Add-in.&lt;/P&gt;
&lt;P align=center&gt;&lt;A href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/SpecifyaProductNamePublisherNameandother_E202/clip_image004%5B9%5D.jpg" mce_href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/SpecifyaProductNamePublisherNameandother_E202/clip_image004%5B9%5D.jpg"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=163 alt=clip_image004[9] src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/SpecifyaProductNamePublisherNameandother_E202/clip_image004%5B9%5D_thumb.jpg" width=488 border=0 mce_src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/SpecifyaProductNamePublisherNameandother_E202/clip_image004%5B9%5D_thumb.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P align=center&gt;Figure 2 : Excel Add-ins Dialog showing Friendly Name and Office Application Description&lt;/P&gt;
&lt;P&gt;&lt;B&gt;SupportURL&lt;/B&gt; - End Users can click on the product name on the Trust Prompt dialog and visit a custom website related to the Solution.&lt;/P&gt;
&lt;P align=center&gt;&lt;A href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/SpecifyaProductNamePublisherNameandother_E202/clip_image006%5B12%5D.jpg" mce_href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/SpecifyaProductNamePublisherNameandother_E202/clip_image006%5B12%5D.jpg"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=203 alt=clip_image006[12] src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/SpecifyaProductNamePublisherNameandother_E202/clip_image006%5B12%5D_thumb.jpg" width=400 border=0 mce_src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/SpecifyaProductNamePublisherNameandother_E202/clip_image006%5B12%5D_thumb.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P align=center&gt;Figure 3 : VSTO Trust Prompt with Friendly Name and link to SupporURL&lt;/P&gt;
&lt;P&gt;The easiest way to specify these properties is to modify the Deployment and Application manifests for the VSTO solution (.vsto and .dll.manifest files).&lt;/P&gt;
&lt;P&gt;&lt;B&gt;To specify the Product, Publisher and SupportURL properties&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;The product name, publisher name and support url properties can all be specified in the deployment manifest, the .vsto file that is generated after publishing the solution. You can open the deployment manifest in a text editor and change the &amp;lt;description&amp;gt; tag to include the properties you want to specify.&lt;/P&gt;
&lt;P&gt;&amp;lt;description asmv2:&lt;B&gt;publisher="Visual Studio (BizApps)"&lt;/B&gt; asmv2:&lt;B&gt;product="My VSTO Solution"&lt;/B&gt; asmv2:&lt;B&gt;supportUrl="http://www.microsoft.com/"&lt;/B&gt; xmlns="urn:schemas-microsoft-com:asm.v1" /&amp;gt;&lt;/P&gt;
&lt;P&gt;Once you have modified the deployment manifest you need to resign it. This can be done using the &lt;A href="http://msdn.microsoft.com/en-us/library/acz3y3te.aspx" mce_href="http://msdn.microsoft.com/en-us/library/acz3y3te.aspx"&gt;Manifest Generation and Editing Tool (mage.exe)&lt;/A&gt; in the .NET Framework SDK, Windows SDK, or Visual Studio 2008. &lt;/P&gt;
&lt;P&gt;Start the Visual Studio command prompt and use mage.exe to resign the deployment manifest:&lt;/P&gt;
&lt;P&gt;mage –sign &lt;I&gt;deploymentmanifest.vsto&lt;/I&gt; –Certfile &lt;I&gt;Certificate.pfx&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;mage –sign MyExcelAddin.vsto –CertFile MyCert.pfx&lt;/P&gt;
&lt;P&gt;&lt;B&gt;To specify Friendly Name and Office Application Description:&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;The Friendly Name and Office Application Description properties can be found in the application manifest under the VSTOV3 namespace.&lt;/P&gt;
&lt;P&gt;The application manifest (the MySolution.dll.manifest file) will typically be found under the Application Files\MySolution_X_X_X_X\ folder where the X’s describe the latest published version of the solution.&lt;/P&gt;
&lt;P&gt;You can open the application manifest and change these properties:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;lt;vstov3:customization xmlns:vstov3="urn:schemas-microsoft-com:vsto.v3"&amp;gt; &lt;BR&gt;&amp;lt;vstov3:appAddIn application="Excel" loadBehavior="3" keyName="ExcelAddIn9"&amp;gt; &lt;BR&gt;&lt;B&gt;&amp;lt;vstov3:friendlyName&amp;gt;My VSTO Solution&amp;lt;/vstov3:friendlyName&amp;gt; &lt;BR&gt;&lt;/B&gt;&lt;B&gt;&amp;lt;vstov3:description&amp;gt;A Sample Add-in created to show the add-in properties work&amp;lt;/vstov3:description&amp;gt; &lt;BR&gt;&lt;/B&gt;&amp;lt;/vstov3:appAddIn&amp;gt; &lt;BR&gt;&amp;lt;/vstov3:customization&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;After you have changed the application manifest, you need to re-sign the application manifest itself. In addition you will also need to refresh the deployment manifest so that it has the new hash for the application manifest. Lastly you need to re-sign the deployment manifest.&lt;/P&gt;
&lt;P&gt;The three steps after editing the application manifest can be performed using mage:&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Resign application manifest:&lt;/B&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Mage –sign &lt;I&gt;applicationmanifest.dll.manifest &lt;/I&gt;–Certfile &lt;I&gt;certfile.pfx &lt;BR&gt;&lt;/I&gt;Example: &lt;BR&gt;Mage –sign “Application Files\MyVsto_1_0_0_0\myvsto.dll.manifest” –Certfile ..\myvsto.pfx&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;B&gt;Update deployment manifest:&lt;/B&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Mage –update &lt;I&gt;deploymentmanifest.vsto&lt;/I&gt; -AppManifest &lt;I&gt;applicationmanifest.manifest &lt;BR&gt;&lt;/I&gt;Example: &lt;BR&gt;Mage –update myvsto.vsto -AppManifest “Application Files\MyVsto_1_0_0_0\myvsto.dll.manifest”&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;B&gt;Resign deployment manifest:&lt;/B&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Mage –sign &lt;I&gt;deploymentmanifest.vsto&lt;/I&gt; –Certfile &lt;I&gt;Certificate.pfx &lt;BR&gt;&lt;/I&gt;Example: &lt;BR&gt;Mage –sign MyExcelAddin.vsto –CertFile MyCert.pfx&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your VSTO solution will now have these properties. The downside of this approach is that you will have to perform these manual steps after every publish. If you want to avoid these manual steps, you can make some changes to the VSTO build targets such that these properties are picked up by Visual Studio during publish. The general idea is that you can specify these properties in your Visual Studio project file (the .vbproj or .csproj) which will in turn be picked up by the build tasks so that they are automatically inserted into the manifest for every publish.&lt;/P&gt;
&lt;P&gt;Changing your targets file is a risky scenario; if you change something incorrectly, none of your projects will build. So to be safe, the first thing you should do is make backups of the files that you are going to change. &lt;/P&gt;
&lt;P&gt;Also to be safe, we will not be editing the main target file but a copy of it. Any VSTO project that you want to specify the publish properties for will use this new modified targets file.&lt;/P&gt;
&lt;P&gt;One more thing to consider before modifying the targets file is that your project may not build correctly if you use the modified targets file and later update the Visual Studio version. If you update Visual Studio, you will have to make the corresponding changes in the new Visual Studio targets file.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Creating a backup and modifying the targets file&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;The file we will be modifying is: &lt;I&gt;Microsoft.VisualStudio.Tools.Office.Office2007.targets&lt;/I&gt;,which can be found in the following directory: &lt;I&gt;%ProgramFiles%\MSBuild\Microsoft\VisualStudio\v9.0\OfficeTools&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;To open the targets file&lt;/B&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Create a backup. Copy the file to a safe location (cannot emphasize this enough). &lt;/LI&gt;
&lt;LI&gt;Create another copy that you will be editing. &lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;Create a copy of the file and save it to your Visual Studio 2008 folder under Documents. On Vista : C:\Users\username\Documents\Visual Studio 2008 &lt;BR&gt;On XP: C:\My Documents\Visual Studio 2008&lt;/LI&gt;
&lt;LI&gt;Rename the filename to : Microsoft.VisualStudio.Tools.Office.Office2007_Properties.targets&lt;/LI&gt;
&lt;LI&gt;You will be modifying this file for the remaining steps.&lt;/LI&gt;&lt;/UL&gt;&lt;/OL&gt;
&lt;P&gt;3. Open the Microsoft.VisualStudio.Tools.Office.Office2007_Properties.targets file in your favorite text editor. &lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;To change the targets file to support Product Name&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;In this example, we treat Friendly Name to be the same as Product Name.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Find the comment for Add-in Options section: &amp;lt;!-- Add-In options --&amp;gt; &lt;BR&gt;The comment is usually followed by the LoadBehavior tag: &amp;lt;LoadBehavior&amp;gt;3&amp;lt;/LoadBehavior&amp;gt;&lt;/LI&gt;
&lt;LI&gt;In the Add-in Options section before the LoadBehavior tag add the following line: &lt;BR&gt;&amp;lt;ProductName Condition=" '$(ProductName)' == '' "&amp;gt;$(TargetName)&amp;lt;/ProductName&amp;gt; &lt;BR&gt;Quote sequence: &lt;BR&gt;Condition = &amp;lt;doublequote&amp;gt;&amp;lt;singlequote&amp;gt; $(ProductName) &amp;lt;singlequote&amp;gt; == &amp;lt;singlequote&amp;gt;&amp;lt;singlequote&amp;gt;&amp;lt;doublequote&amp;gt;&lt;/LI&gt;
&lt;LI&gt;Find all instances of FriendlyName. Usually the FriendlyName is assigned to $TargetName: FriendlyName="$(TargetName)" &lt;BR&gt;Change all instances to: FriendlyName = “$(ProductName)” &lt;BR&gt;There will be three places in all where you need to update FriendlyName.&lt;/LI&gt;
&lt;LI&gt;Search for Target GenerateDeploymentManifestForPublishing: &lt;BR&gt;&amp;lt;Target Name="GenerateDeploymentManifestForPublishing"&amp;gt;&lt;/LI&gt;
&lt;LI&gt;Inside this target there is a GenerateDeploymentManifest task: &lt;BR&gt;&amp;lt;GenerateDeploymentManifest &lt;BR&gt;EntryPoint="@(ApplicationManifestWithPathForPublishingCollection)" &lt;BR&gt;AssemblyName="$(DeploymentManifestFileName)" &lt;BR&gt;AssemblyVersion="$(PublishVersion)" &lt;BR&gt;MapFileExtensions="$(MapFileExtensions)" &lt;BR&gt;OutputManifest="@(DeploymentManifestWithPathForPublishingCollection)" &lt;BR&gt;Platform="$(PlatformTarget)" &lt;BR&gt;Install="false" &lt;BR&gt;/&amp;gt;&lt;/LI&gt;
&lt;LI&gt;Add a Product attribute to this task: &lt;BR&gt;&amp;lt;GenerateDeploymentManifest &lt;BR&gt;EntryPoint="@(ApplicationManifestWithPathForPublishingCollection)" &lt;BR&gt;AssemblyName="$(DeploymentManifestFileName)" &lt;BR&gt;AssemblyVersion="$(PublishVersion)" &lt;BR&gt;&lt;B&gt;Product="$(ProductName)" &lt;BR&gt;&lt;/B&gt;MapFileExtensions="$(MapFileExtensions)" &lt;BR&gt;OutputManifest="@(DeploymentManifestWithPathForPublishingCollection)" &lt;BR&gt;Platform="$(PlatformTarget)" &lt;BR&gt;Install="false" &lt;BR&gt;/&amp;gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;To change the targets file to support Publisher Name&lt;/B&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Search for Target GenerateDeploymentManifestForPublishing: &lt;BR&gt;&amp;lt;Target Name="GenerateDeploymentManifestForPublishing"&amp;gt;&lt;/LI&gt;
&lt;LI&gt;Inside this target there is a GenerateDeploymentManifest task: &lt;BR&gt;&amp;lt;GenerateDeploymentManifest &lt;BR&gt;EntryPoint="@(ApplicationManifestWithPathForPublishingCollection)" &lt;BR&gt;AssemblyName="$(DeploymentManifestFileName)" &lt;BR&gt;AssemblyVersion="$(PublishVersion)" &lt;BR&gt;&lt;B&gt;Product="$(ProductName)" &lt;BR&gt;&lt;/B&gt;MapFileExtensions="$(MapFileExtensions)" &lt;BR&gt;OutputManifest="@(DeploymentManifestWithPathForPublishingCollection)" &lt;BR&gt;Platform="$(PlatformTarget)" &lt;BR&gt;Install="false" &lt;BR&gt;/&amp;gt;&lt;/LI&gt;
&lt;LI&gt;Add a Publisher attribute to this task: &lt;BR&gt;&amp;lt;GenerateDeploymentManifest &lt;BR&gt;EntryPoint="@(ApplicationManifestWithPathForPublishingCollection)" &lt;BR&gt;AssemblyName="$(DeploymentManifestFileName)" &lt;BR&gt;AssemblyVersion="$(PublishVersion)" &lt;BR&gt;&lt;B&gt;Product="$(ProductName)" &lt;BR&gt;&lt;/B&gt;&lt;B&gt;Publisher="$(PublisherName)" &lt;BR&gt;&lt;/B&gt;MapFileExtensions="$(MapFileExtensions)" &lt;BR&gt;OutputManifest="@(DeploymentManifestWithPathForPublishingCollection)" &lt;BR&gt;Platform="$(PlatformTarget)" &lt;BR&gt;Install="false" &lt;BR&gt;/&amp;gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;To changing the targets file to support SupportURL&lt;/B&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Search for Target InitializePublishProperties : &lt;BR&gt;&amp;lt;Target Name="InitializePublishProperties"&amp;gt; &lt;BR&gt;It is followed by a CreateProperty task: &lt;BR&gt;&amp;lt;CreateProperty Value="Application Files"&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Output PropertyName="ApplicationFilesFolderName" TaskParameter="Value"/&amp;gt; &lt;BR&gt;&amp;lt;/CreateProperty&amp;gt;&lt;/LI&gt;
&lt;LI&gt;After the CreateProperty task add the following: &lt;BR&gt;&lt;B&gt;&amp;lt;FormatUrl InputUrl="$(SupportUrl)"&amp;gt;&amp;nbsp;&lt;BR&gt;&lt;/B&gt;&lt;B&gt;&amp;lt;Output TaskParameter="OutputUrl" PropertyName = "_DeploymentFormattedSupportUrl"/&amp;gt;&lt;BR&gt;&lt;/B&gt;&lt;B&gt;&amp;lt;/FormatUrl&amp;gt;&lt;/B&gt;&lt;/LI&gt;
&lt;LI&gt;Search for Target GenerateDeploymentManifestForPublishing: &lt;BR&gt;&amp;lt;Target Name="GenerateDeploymentManifestForPublishing"&amp;gt;&lt;/LI&gt;
&lt;LI&gt;Inside this target there is a GenerateDeploymentManifest task: &lt;BR&gt;&amp;lt;GenerateDeploymentManifest &lt;BR&gt;EntryPoint="@(ApplicationManifestWithPathForPublishingCollection)" &lt;BR&gt;AssemblyName="$(DeploymentManifestFileName)" &lt;BR&gt;AssemblyVersion="$(PublishVersion)" &lt;BR&gt;&lt;B&gt;Product="$(ProductName)" &lt;BR&gt;&lt;/B&gt;&lt;B&gt;Publisher="$(PublisherName)" &lt;BR&gt;&lt;/B&gt;MapFileExtensions="$(MapFileExtensions)" &lt;BR&gt;OutputManifest="@(DeploymentManifestWithPathForPublishingCollection)" &lt;BR&gt;Platform="$(PlatformTarget)" &lt;BR&gt;Install="false" &lt;BR&gt;/&amp;gt;&lt;/LI&gt;
&lt;LI&gt;Add a Publisher attribute to this task: &lt;BR&gt;&amp;lt;GenerateDeploymentManifest &lt;BR&gt;EntryPoint="@(ApplicationManifestWithPathForPublishingCollection)" &lt;BR&gt;AssemblyName="$(DeploymentManifestFileName)" &lt;BR&gt;AssemblyVersion="$(PublishVersion)" &lt;BR&gt;&lt;B&gt;Product="$(ProductName)" &lt;BR&gt;&lt;/B&gt;&lt;B&gt;Publisher="$(PublisherName)" &lt;BR&gt;&lt;/B&gt;&lt;B&gt;SupportUrl="$(_DeploymentFormattedSupportUrl)" &lt;BR&gt;&lt;/B&gt;MapFileExtensions="$(MapFileExtensions)" &lt;BR&gt;OutputManifest="@(DeploymentManifestWithPathForPublishingCollection)" &lt;BR&gt;Platform="$(PlatformTarget)" &lt;BR&gt;Install="false" &lt;BR&gt;/&amp;gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;B&gt;To change the targets file to support Office application description&lt;/B&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Search the text file for “OfficeApplicationDescription”&lt;/LI&gt;
&lt;LI&gt;You will find a line as follows: &lt;BR&gt;&amp;lt;OfficeApplicationDescription Condition="'$(VSTO_ProjectType)' == 'Application'"&amp;gt;$(TargetName) - $(OfficeApplication) add-in created with Visual Studio Tools for Office&amp;lt;/OfficeApplicationDescription&amp;gt;&lt;/LI&gt;
&lt;LI&gt;Modify it to: &lt;BR&gt;&amp;lt;OfficeApplicationDescription &lt;B&gt;Condition="'$(OfficeApplicationDescription)' == '' and&lt;/B&gt; '$(VSTO_ProjectType)' == 'Application'"&amp;gt;$(TargetName) - $(OfficeApplication) add-in created with Visual Studio Tools for Office&amp;lt;/OfficeApplicationDescription&amp;gt; &lt;BR&gt;Note the correct quotes are as follows: &lt;BR&gt;Condition = &amp;lt;doublequote&amp;gt; &amp;lt;singlequote&amp;gt; $(OfficeApplicationDescription) &amp;lt;singlequote&amp;gt; == &amp;lt;singlequote&amp;gt;&amp;lt;singlequote&amp;gt;&lt;/LI&gt;
&lt;LI&gt;The very next line after this also needs to be modified: &lt;BR&gt;&amp;lt;OfficeApplicationDescription Condition="'$(VSTO_ProjectType)' == 'Document'"&amp;gt;$(TargetName) - $(OfficeApplication) document created with Visual Studio Tools for Office&amp;lt;/OfficeApplicationDescription&amp;gt;&lt;/LI&gt;
&lt;LI&gt;Modify it to: &lt;BR&gt;&amp;lt;OfficeApplicationDescription Condition="'$(OfficeApplicationDescription)' == '' and '$(VSTO_ProjectType)' == 'Document'"&amp;gt;$(TargetName) - $(OfficeApplication) document created with Visual Studio Tools for Office&amp;lt;/OfficeApplicationDescription&amp;gt; &lt;BR&gt;Note the correct quotes are as follows: &lt;BR&gt;Condition = &amp;lt;doublequote&amp;gt; &amp;lt;singlequote&amp;gt; $(OfficeApplicationDescription) &amp;lt;singlequote&amp;gt; == &amp;lt;singlequote&amp;gt;&amp;lt;singlequote&amp;gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;You are done modifying the targets file. The next step is to modify your project file and specify values for these properties. You will have to modify any project that you want to specify these properties for. The Visual Studio projects file is the .vbproj or .csproj file associated with your project. You can open up this file in a text editor. &lt;/P&gt;
&lt;P&gt;You will have to modify the project so that it starts using the new targets file which you have created:&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Modify project to use new target file&lt;/B&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Find the following comment in the projects file: &lt;BR&gt;&amp;lt;!-- Include additional build rules for an Office application add-in. --&amp;gt;&lt;/LI&gt;
&lt;LI&gt;Replace the existing pointer to the targets file: &lt;BR&gt;&amp;lt;Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.Office2007.targets" /&amp;gt; &lt;BR&gt;With the path to the new targets file: &lt;BR&gt;&amp;lt;Import Project="&lt;B&gt;c:\users\username\documents\Visual Studio 2008\ Microsoft.VisualStudio.Tools.Office.Office2007_Properties.targets&lt;/B&gt;" /&amp;gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;B&gt;Specify Properties in project file&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;Inside the first &amp;lt;PropertyGroup&amp;gt; tag you can add the following properties:&lt;/P&gt;
&lt;P&gt;&amp;lt;ProductName&amp;gt;My VSTO Solution&amp;lt;/ProductName&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;PublisherName&amp;gt;Visual Studio (BizApps)&amp;lt;/PublisherName&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;OfficeApplicationDescription&amp;gt;A Sample Add-in created to show the add-in properties work&amp;lt;/OfficeApplicationDescription&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;SupportUrl&amp;gt;http://www.microsoft.com&amp;lt;/SupportUrl&amp;gt;&lt;/P&gt;
&lt;P&gt;Once you have added these properties to the project file you can save the project and open it in Visual Studio. When you open this project you will get a warning stating that the project has been modified to use custom build steps. Choose the option to Load the project normally and proceed. From now onwards, these properties will be automatically be inserted into the manifest during publish. Any updates you make to these properties will also automatically be picked up by the publish system.&lt;/P&gt;
&lt;P&gt;Modifying the targets file is a rather long and elaborate procedure, but once you complete it successfully you have the benefit of being able to specify these properties easily for any project.&lt;/P&gt;
&lt;P&gt;Hope you find this post useful. Please let us know your comments.&lt;/P&gt;
&lt;P&gt;Saurabh Bhatia, Program Manager&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8592351" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vsto/archive/tags/ClickOnce/default.aspx">ClickOnce</category><category domain="http://blogs.msdn.com/vsto/archive/tags/VSTO/default.aspx">VSTO</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+2007/default.aspx">Office 2007</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Deployment/default.aspx">Deployment</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Manifest/default.aspx">Manifest</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Saurabh+Bhatia/default.aspx">Saurabh Bhatia</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Publisher+Name/default.aspx">Publisher Name</category><category domain="http://blogs.msdn.com/vsto/archive/tags/SupportUrl/default.aspx">SupportUrl</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Product+Name/default.aspx">Product Name</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Add+Remove+Programs/default.aspx">Add Remove Programs</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+Addin+Properties/default.aspx">Office Addin Properties</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Programs+and+Features/default.aspx">Programs and Features</category></item></channel></rss>