VSTO, Outlook add-ins, and Visual Studio 2015

廉价感情. 提交于 2019-11-30 13:40:00

问题


Starting with Visual Studio RC, Visual Studio 2015 appears to no longer support the Office Add-In project types from Visual Studio Tools for Office (VSTO). Lots of googlin' and questions to PMs in the MS blogs have revealed no useful information; but perhaps other in the community know more. Opening a VSTO project yield "(incompatible)". so:

  1. what is the status of VSTO and Visual Studio 2015
  2. Is there a workaround to open the old project types in VS 2015

I don't have 2013 anymore because i wiped that machine...


回答1:


Do you have the Community edition of VS installed?

Try to install https://aka.ms/getlatestofficedevtools .




回答2:


I am using VS 2015 Enterprise and I solved it with follow steps.

  1. Edit office project 's .Csproj file with an XML editor find node: project\PropertyGroup, delete ProjectTypeGuids node;

  2. close .sln.

  3. reopen .sln.

My ProjectTypeGuids is <ProjectTypeGuids>{BAA0C2D2-18E2-41B9-852F-F413020CAA33};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>.

It seems VS can't recognize the typeGuids.

/**********Thanx Mogsdad for format my code**********/

When i try debug this project,i found it cant be debuged.Because it's projectType has losed.So i recover the .csproj file.

I notice another config node @<Project><ProjectExtensions><VisualStudio><FlavorProperties><ProjectProperties>. This node has a attribute named ApplicationType and its value is 'XLS',i modified it to 'Excel',the project seems work fine.




回答3:


With the help from James Randal we found an answer. We created a brand new empty Sharepoint Add-in then compared a newly created .csproj XML with the OfficeDev PNP .csproj XML.

Deleting the GUID's above does not help as then Visual Studio does not recognize the project as a Sharepoint project.

Answer : Edit the .csproj XML to change <TargetOfficeVersion> 16.0 </TargetOfficeVersion> to be 16.1 worked for me. You will still need to right-click on Sharepoint Project and install missing features but it finishes without the error message now.



来源:https://stackoverflow.com/questions/31570661/vsto-outlook-add-ins-and-visual-studio-2015

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!