tag:help.appveyor.com,2012-11-13:/discussions/problems/2892-vsto-visual-studio-tools-for-officeAppVeyor: Discussion 2018-08-25T02:01:46Ztag:help.appveyor.com,2012-11-13:Comment/377522242015-08-26T07:42:24Z2015-08-26T07:42:24ZVSTO – Visual Studio Tools for Office<div><p>Hi Jordi,</p>
<p>Last time I tried the following worked.</p>
<p>On your developer machine with VS 2013 and VSTO installed (and
provided <code>7z.exe</code> is in PATH):</p>
<pre>
<code>7z a c:\projects\vsto-pack.zip "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.Tools.Applications.BuildTasks.dll"
7z a c:\projects\vsto-pack.zip "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.VisualStudio.Tools.Office.BuildTasks\v4.0_12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Tools.Office.BuildTasks.dll"
7z a c:\projects\vsto-pack.zip "Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets"
7z a c:\projects\vsto-pack.zip "Program Files\MSBuild\Microsoft.VisualStudio.OfficeTools.targets"
7z a c:\projects\vsto-pack.zip "Program Files\Reference Assemblies\Microsoft\VSTO40\*"
7z a c:\projects\vsto-pack.zip "Program Files (x86)\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\*"
7z a c:\projects\vsto-pack.zip "Program Files (x86)\Microsoft SDKs\Windows\v8.1A\Bootstrapper\Packages\VSTOR40\*"
reg export "HKLM\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\VS11VSTOCommonPIA" c:\projects\vsto1.reg
reg export "HKLM\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\VS11VSTOOffice14PIA" c:\projects\vsto2.reg
reg export "HKLM\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\VS11VSTOOffice15PIA" c:\projects\vsto3.reg
reg export "HKLM\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\VSTO 4.0 Reference Assemblies" c:\projects\vsto4.reg
7z a c:\projects\vsto-pack.zip c:\projects\*.reg</code>
</pre>
<p>You should get <code>c:\projects\vsto-pack.zip</code> with bunch
of assemblies and reg files inside. Upload that zip to somewhere
(FTP, Azure blob, AWS S3, etc.)</p>
<p>Next, we'll assume zip URL is
<code>http://myserver.com/vsto-pack.zip</code>.</p>
<p>To download package on server add this to build script (or
appveyor.yml):</p>
<pre>
<code>appveyor DownloadFile http://myserver.com/vsto-pack.zip</code>
</pre>
<p>This will download package to the root of build folder.</p>
<p>Unpack it to <code>C:</code> thus assemblies go to their
original locations:</p>
<pre>
<code>7z x -oC:\ vsto-pack.zip</code>
</pre>
<p>First two assemblies with MSBuild tasks should be put to GAC on
build server:</p>
<pre>
<code>"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\gacutil" /i C:\Microsoft.VisualStudio.Tools.Applications.BuildTasks.dll
"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\gacutil" /i C:\Microsoft.VisualStudio.Tools.Office.BuildTasks.dll</code>
</pre>
<p>and finally import registry keys:</p>
<pre>
<code>reg import C:\vsto1.reg
reg import C:\vsto2.reg
reg import C:\vsto3.reg
reg import C:\vsto4.reg</code>
</pre>
<p>I can't check that locally now as I don't have VSTO installed,
but I hope you got the idea.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/377522242015-10-29T17:12:39Z2015-10-29T17:12:40ZVSTO – Visual Studio Tools for Office<div><p>Hi Feodor,</p>
<p>I've followed the steps you provided but I'm getting an
error:</p>
<p>C:\projects\redbooth-outlook\Redbooth.Outlook.sln" (default
target) (1) -><br>
"C:\projects\redbooth-outlook\Redbooth.Outlook.Test\Redbooth.Outlook.Test.csproj"
(default target) (5) ->
"C:\projects\redbooth-outlook\Redbooth.Outlook\Redbooth.Outlook.csproj"
(default target) (2:2) ->
C:\projects\redbooth-outlook\Redbooth.Outlook\Redbooth.Outlook.csproj(475,3):
error MSB4019: The imported project "C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v14.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets"
was not found. Confirm that the path in the declaration is correct,
and that the file exists on disk.</p>
<pre>
<code>0 Warning(s)
2 Error(s)</code>
</pre>
<p>Time Elapsed 00:00:04.16<br>
Command exited with code 1</p>
<p>Is it a problem with the Office version (provided your example
was working with v12.0? Or maybe I have to copy the target file to
the Program files path?</p>
<p>Thank you for your help.</p>
<p>Best regards,</p>
<p>Roberto.</p></div>roberto.huertastag:help.appveyor.com,2012-11-13:Comment/377522242015-10-29T23:59:45Z2015-10-29T23:59:45ZVSTO – Visual Studio Tools for Office<div><p>Yes, that "recipe" was for VS 2013 (12.0) and you could adopt it
for VS 2015 (14.0). I guess there would be not only paths to
assemblies and target files, but different strong assembly versions
as well.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/377522242015-10-30T09:39:22Z2015-10-30T09:39:23ZVSTO – Visual Studio Tools for Office<div><p>Hi Feodor,</p>
<p>I copied the .targets files and now I'm getting this error:</p>
<p>C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v14.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(264,9):
error MSB3482: An error occurred while signing: Invalid provider
type specified.</p>
<p>I'm not really sure if it's related to the Clickonce certificate
or it's still related to the previous VSTO dlls issues.</p>
<p>I've signed several Clickonce packages before in AppVeyor wihout
any problem but in this case, the certificate had a .p12 extension
instead of .pfx. I just changed the extension but I suspect (be
looking a the error code above) that it has to do with some sort of
server incompatibility.</p>
<p>Do you know anything about this?</p>
<p>Kind regards,<br>
Roberto.</p></div>roberto.huertastag:help.appveyor.com,2012-11-13:Comment/377522242015-10-30T09:53:11Z2015-10-30T09:53:16ZVSTO – Visual Studio Tools for Office<div><p>Hi Feodor,</p>
<p>find attached what I have in my vsto-pack.zip.<br>
I'm going to try to copy all the other folders and files to its
original location and let you know if it works.</p>
<p>If you have any other idea, please let me know.</p>
<p>Best regards,<br>
Roberto</p></div>roberto.huertastag:help.appveyor.com,2012-11-13:Comment/377522242015-10-30T13:37:23Z2015-10-30T13:37:24ZVSTO – Visual Studio Tools for Office<div><p>Hi Feodor,</p>
<p>I've got it working!</p>
<p>I will summarize the process later in another post</p></div>roberto.huertastag:help.appveyor.com,2012-11-13:Comment/377522242015-10-30T13:45:40Z2015-10-30T13:45:40ZVSTO – Visual Studio Tools for Office<div><p>Fantastic! :) looking forward to see your solution!</p>
<ul>
<li>Feodor</li>
</ul></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/377522242015-10-30T14:58:03Z2015-10-30T14:58:28ZVSTO – Visual Studio Tools for Office<div><p>Hi Feodor,</p>
<p>I've confirmed that the previous issue is related to the
certificate:</p>
<p>(VisualStudioForApplicationsBuild target) -> C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v14.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(264,9):
error MSB3482: An error occurred while signing: Invalid provider
type specified.</p>
<p>If I use another certificate it works ok. Do you have any
insights on this matter?</p>
<p>I'll take a look at it too.</p>
<p>Best regards,<br>
Roberto.</p></div>roberto.huertastag:help.appveyor.com,2012-11-13:Comment/377522242015-10-30T15:44:40Z2015-10-30T15:44:41ZVSTO – Visual Studio Tools for Office<div><p>Hi Feodor,</p>
<p>I have fixed the issue transforming the .p12 file to pfx and
it's working.</p>
<p>Best regards,</p>
<p>Roberto</p></div>roberto.huertastag:help.appveyor.com,2012-11-13:Comment/377522242015-10-30T16:35:13Z2015-10-30T16:35:13ZVSTO – Visual Studio Tools for Office<div><p>Great! Could you please share final script/solution? Thank
you!</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/377522242015-11-06T18:36:35Z2015-11-06T18:36:35ZVSTO – Visual Studio Tools for Office<div><p>Hi Feodor,</p>
<p>please find here the whole explanation of my case and the
solution I found to make it work:<br>
<a href="http://codecoding.com/using-appveyor-to-build-a-vsto-project/">http://codecoding.com/using-appveyor-to-build-a-vsto-project/</a></p>
<p>Best regards,<br>
Roberto.</p></div>roberto.huertastag:help.appveyor.com,2012-11-13:Comment/377522242015-11-06T18:44:04Z2015-11-06T18:44:04ZVSTO – Visual Studio Tools for Office<div><p>Looks great, thank you very much!</p></div>Feodor Fitsner