Original Author : McLean scholar Field
Original article link: Http://blogs.msdn.com/ B /vsto/archive/2010/06/02/fixing-compile-and-run-time-errors-after-retargeting-vsto-projects-to-the-net-framework-4-mclean-schofield.aspx
NowVisual Studio 2010Released. You want to use. NET framework 4ProvidedNew features, you can upgrade previous projects. Or you have usedVisual Studio 2010Release. NET Framework 3.5But now we need to deploy the project in. NET Framework 4.0. Deploy old projects in. NET Framework 4.0.During runtime, compilation and runtime errors may occur. How can I solve these errors?
Redirect Vsto Project in The. NET framework 4 Is very simple. If you use Visual Studio 2010 Create a project. You can use the operation guide to redirect the link. Not Installed . NET Framework 3.5 If you are redirecting a project Visual Studio 2010 ( . NET Framework 4.0 ) You can direct the project . NET Framework 4.0 . For more information, refer to the previousArticle"Redirect when project upgrade" .
When the project is redirected, most of your work is complete. You can start writing in the projectCode. Of course many projects - Any project is used Ribbon designer, Outlook Use Form region, Excel/Word The project uses some specific functions, such Smart Tags And Methods Getvstoobject/hasvstoobject- When you redirect a project, you will get a compilation error. , Or Add-in Unable to work. In these cases, your code needs some modifications. When you encounter these problems, you can refer to the following Msdn Provided articles to modify your code :
Upgrade. NET Framework 4.0HourOfficeProject changes.
Upgrade. NET Framework 4.0UpdateExcel/WordProject.
Upgrade to . net Framework 4.0 hour , Update ribbon Custom .
Upgrade. NET Framework 4.0Hour, OutlookProject updateForm regions.
In addition to the manual instruction, the following video tutorials relay projects under several special circumstances. See the following link:
How do I do:Redirection. NET Framework 3.5 outlook add-inTo. NET Framework 4.0.
How do I do:Redirection. NET Framework 3.5 Word 2007 add-inTo. NET Framework 4.0.
UseVisual Studio 2010UpgradeOutlookClientProgramTo. NET Framework 4.0.
Background
WhenVstoDepartment execution supports new. NET framework 4"EmbeddedInterOPType"Feature, they also modified the specificVstoSome features of the program model during runtime. For example,EmbeddedInterOPType can only be called with interface.VstoWhen running. NET framework 4More supported interfaces rather than classes. These changes are based on the production code and the developer's habit of writing code, so you need to manually change the code for a new project.
In. NET framework 4,If you are interested in reading moreEmbeddedInterOPType function. These changes are aboutVisual Studio 2010 toolsTools andOfficeRuntime. Refer to the following article.
Blog posts
Vsto 2010Runtime Design
IntroductionVsto 2010Runtime Components
Why upgrade. NET Framework 3.5To4.0.
ExploitationVisual Studio 2010Upgrade Project
MsdnArticle:
ChangeOfficeProject design redirection. NET Framework 4.0
Visual Studio Tools for officeRuntime Overview
Design and CreationOfficeSolution.