VSTO – Visual Studio Tools for Office
Hello, I'm trying to build a repo in AppVeyor but it apparently fails because it doesn't find the VSTO. I've seen in other support threads that people managed to do it but I'm not sure if I need to configure something or I just need to install them (and don't know how) in a before script.
> C:\projects\redbooth-outlook\Redbooth.Outlook\Redbooth.Outlook.csproj(432,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 <Import> declaration is correct, and that the file exists on disk.
Thanks for your help!
best,
Jordi
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Feodor Fitsner on 26 Aug, 2015 07:42 AM
Hi Jordi,
Last time I tried the following worked.
On your developer machine with VS 2013 and VSTO installed (and provided
7z.exe
is in PATH):You should get
c:\projects\vsto-pack.zip
with bunch of assemblies and reg files inside. Upload that zip to somewhere (FTP, Azure blob, AWS S3, etc.)Next, we'll assume zip URL is
http://myserver.com/vsto-pack.zip
.To download package on server add this to build script (or appveyor.yml):
This will download package to the root of build folder.
Unpack it to
C:
thus assemblies go to their original locations:First two assemblies with MSBuild tasks should be put to GAC on build server:
and finally import registry keys:
I can't check that locally now as I don't have VSTO installed, but I hope you got the idea.
2 Posted by roberto.huertas on 29 Oct, 2015 05:12 PM
Hi Feodor,
I've followed the steps you provided but I'm getting an error:
C:\projects\redbooth-outlook\Redbooth.Outlook.sln" (default target) (1) ->
"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 <Import> declaration is correct, and that the file exists on disk.
0 Warning(s)
2 Error(s)
Time Elapsed 00:00:04.16
Command exited with code 1
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?
Thank you for your help.
Best regards,
Roberto.
Support Staff 3 Posted by Feodor Fitsner on 29 Oct, 2015 11:59 PM
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.
4 Posted by roberto.huertas on 30 Oct, 2015 09:39 AM
Hi Feodor,
I copied the .targets files and now I'm getting this error:
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.
I'm not really sure if it's related to the Clickonce certificate or it's still related to the previous VSTO dlls issues.
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.
Do you know anything about this?
Kind regards,
Roberto.
5 Posted by roberto.huertas on 30 Oct, 2015 09:53 AM
Hi Feodor,
find attached what I have in my vsto-pack.zip.
I'm going to try to copy all the other folders and files to its original location and let you know if it works.
If you have any other idea, please let me know.
Best regards,
Roberto
6 Posted by roberto.huertas on 30 Oct, 2015 01:37 PM
Hi Feodor,
I've got it working!
I will summarize the process later in another post
Support Staff 7 Posted by Feodor Fitsner on 30 Oct, 2015 01:45 PM
Fantastic! :) looking forward to see your solution!
- Feodor
8 Posted by roberto.huertas on 30 Oct, 2015 02:58 PM
Hi Feodor,
I've confirmed that the previous issue is related to the certificate:
(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.
If I use another certificate it works ok. Do you have any insights on this matter?
I'll take a look at it too.
Best regards,
Roberto.
9 Posted by roberto.huertas on 30 Oct, 2015 03:44 PM
Hi Feodor,
I have fixed the issue transforming the .p12 file to pfx and it's working.
Best regards,
Roberto
Support Staff 10 Posted by Feodor Fitsner on 30 Oct, 2015 04:35 PM
Great! Could you please share final script/solution? Thank you!
11 Posted by roberto.huertas on 06 Nov, 2015 06:36 PM
Hi Feodor,
please find here the whole explanation of my case and the solution I found to make it work:
http://codecoding.com/using-appveyor-to-build-a-vsto-project/
Best regards,
Roberto.
Support Staff 12 Posted by Feodor Fitsner on 06 Nov, 2015 06:44 PM
Looks great, thank you very much!