none
Converting VSTO projekt from VS2008 in Windows XP(32) Office 2007(32) to Windows 7(64) and Office 2010(64) RRS feed

  • Question

  • Hi

    I have created a fairly large Office 2007-Addin package wich consists of components for Word, Excel, Powerpoint and Outlook.

    I have used Visual Studio 2008 (Visual Basic) and the development environment aswell as the deployment environment has been Windows XP 32-bit and Office 2007 Standard 32-bit.

    Later this year, my customer is migrating to a completely new platform, with Windows 7 64-bit and Office 2010 64-bit.
    My task is deliver an Office 2010 Addin installation package, like the current one, for this new platform.

    Which way should I go?

    I have tried using Visual Studio 2008 in this new client environment. I have started with the Word-project, but the project won't compile, because the compiler can't find Word 2007. I then installed Office 2010 PIA, and checked all referenses in the project, but with the same result.

    I then tried switching to Visual Studio 2010. The project is "converted" and no compilation errors occur. But the addin will not load.

    I get an error "CannotCreateCustomizationDomainException" and the Addin sets to load manually.

    What am I doing wrong here?

    Thanks in advance


    Best Regards Peter Karlström Midrange AB, Sweden

    Friday, February 10, 2012 11:12 AM

Answers

  • Hi peter,

    Thanks for your post.

    Just check this blog for steps how to upgrade VSTO solutions:

    Upgrading VSTO Projects to use with Visual Studio 2010 

    In addition, if your solution has multiple VSTO add-in project, I would recommend you to upgrade one by one to avoid some unexpected issues.

    I look forward to hearing of you soon.


    Calvin Gao[MSFT]
    MSDN Community Support | Feedback to us

    Monday, February 13, 2012 4:21 AM
    Moderator
  • Hi

    Problem solved.

    The project involved a 32-bit not selfRegistrated DLL which came in conflict with the demands on compiling the project with AnyCPU in order to get it to work in a 64-bit Office application.

    After removing and replacing the functionality in the 3rd party DLL all works as expected.

    Thanks anyway for all input in this.


    Best Regards Peter Karlström Midrange AB, Sweden

    Tuesday, February 21, 2012 5:23 PM

All replies

  • after switching to vs2010 make sure that your add-ins compile as 'anyCPU' and not bit-specific versions, also check in project references that they target .net 4.0, which should be the easiest way to deliver something 'working' for client.
    Friday, February 10, 2012 11:40 AM
  • Hi Damian

    Thanks for the fast reply.

    Did as you suggested, and now I get a compilation error. Se below:

    Error	1	The "FindRibbons" task failed unexpectedly.
    System.IO.FileNotFoundException: Could not load file or assembly 'SKB Mallapplikation .NET, Version=4.0.5.5, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Det går inte att hitta filen.
    File name: 'SKB Mallapplikation .NET, Version=4.0.5.5, Culture=neutral, PublicKeyToken=null'
       at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
       at System.Reflection.Assembly.Load(String assemblyString)
       at System.UnitySerializationHolder.GetRealObject(StreamingContext context)
    
       at Microsoft.Build.Framework.ITask.Execute()
       at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
       at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)
    
    === Pre-bind state information ===
    LOG: User = MIDRANGE\test1
    LOG: DisplayName = SKB Mallapplikation .NET, Version=4.0.5.5, Culture=neutral, PublicKeyToken=null
     (Fully-specified)
    LOG: Appbase = file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/
    LOG: Initial PrivatePath = NULL
    Calling assembly : (Unknown).
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.Config
    LOG: Using host configuration file: 
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
    LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/SKB Mallapplikation .NET.DLL.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/SKB Mallapplikation .NET/SKB Mallapplikation .NET.DLL.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PublicAssemblies/SKB Mallapplikation .NET.DLL.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PublicAssemblies/SKB Mallapplikation .NET/SKB Mallapplikation .NET.DLL.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/SKB Mallapplikation .NET.DLL.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/SKB Mallapplikation .NET/SKB Mallapplikation .NET.DLL.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/SKB Mallapplikation .NET.DLL.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/SKB Mallapplikation .NET/SKB Mallapplikation .NET.DLL.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/SKB Mallapplikation .NET.DLL.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/SKB Mallapplikation .NET/SKB Mallapplikation .NET.DLL.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/x86/SKB Mallapplikation .NET.DLL.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/x86/SKB Mallapplikation .NET/SKB Mallapplikation .NET.DLL.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/Editor/SKB Mallapplikation .NET.DLL.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/Editor/SKB Mallapplikation .NET/SKB Mallapplikation .NET.DLL.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Platform/Debugger/SKB Mallapplikation .NET.DLL.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Platform/Debugger/SKB Mallapplikation .NET/SKB Mallapplikation .NET.DLL.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/SKB Mallapplikation .NET.EXE.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/SKB Mallapplikation .NET/SKB Mallapplikation .NET.EXE.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PublicAssemblies/SKB Mallapplikation .NET.EXE.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PublicAssemblies/SKB Mallapplikation .NET/SKB Mallapplikation .NET.EXE.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/SKB Mallapplikation .NET.EXE.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/SKB Mallapplikation .NET/SKB Mallapplikation .NET.EXE.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/SKB Mallapplikation .NET.EXE.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/SKB Mallapplikation .NET/SKB Mallapplikation .NET.EXE.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/SKB Mallapplikation .NET.EXE.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/SKB Mallapplikation .NET/SKB Mallapplikation .NET.EXE.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/x86/SKB Mallapplikation .NET.EXE.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/x86/SKB Mallapplikation .NET/SKB Mallapplikation .NET.EXE.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/Editor/SKB Mallapplikation .NET.EXE.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/Editor/SKB Mallapplikation .NET/SKB Mallapplikation .NET.EXE.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Platform/Debugger/SKB Mallapplikation .NET.EXE.
    LOG: Attempting download of new URL file:///c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Platform/Debugger/SKB Mallapplikation .NET/SKB Mallapplikation .NET.EXE.
    	SKBMall
    

    I have to say this doesn't make much sense to me. Why is it looking for my DLL in the Visual Studio 10.0/Common7-directory. Shouldn't it look for it in the projects bin and obj folders?


    Best Regards Peter Karlström Midrange AB, Sweden

    Friday, February 10, 2012 12:25 PM
  • yes, it does not make any sens for me either. But it looks like VS is not treating your app as an office add-in anymore (application config is devenv.exe.config). Could you verify that your main project (that starts when you press F5 to debug) is still an office add-in one?
    Friday, February 10, 2012 2:14 PM
  • Hi peter,

    Thanks for your post.

    Just check this blog for steps how to upgrade VSTO solutions:

    Upgrading VSTO Projects to use with Visual Studio 2010 

    In addition, if your solution has multiple VSTO add-in project, I would recommend you to upgrade one by one to avoid some unexpected issues.

    I look forward to hearing of you soon.


    Calvin Gao[MSFT]
    MSDN Community Support | Feedback to us

    Monday, February 13, 2012 4:21 AM
    Moderator
  • Hi Damian

    Sorry for the delay.

    There's only one project "in the project". I can't find any reference another host or to the text "devenv.exe.config" in the project files.

    The project was a working VSTO Addin before the automatic conversion by VS2010. The conversion logs makes no complaints,
    and only converted object is the vbproj-file.

    How can I verify that the project is an office add-in one?

    Thanks


    Best Regards Peter Karlström Midrange AB, Sweden

    Tuesday, February 14, 2012 7:53 AM
  • Right click project, choose Unload

    then right click again and choose edit

    find entry ProjectTypeGuids and paste it here.

    Tuesday, February 14, 2012 8:46 AM
  • Hi Damian

    I wonder if you are using C# as project language. In VB there is no options like you mention.

    Thanks


    Best Regards Peter Karlström Midrange AB, Sweden

    Tuesday, February 14, 2012 9:03 AM
  • yes, i use c#. Please check Project menu in VS, maybe Unload project will be there, otherwise, just open in notepad vbproj file on disk and check for entry i described above.
    Tuesday, February 14, 2012 9:04 AM
  • Hi Calvin

    I have followed this guide when upgrading my project. The original Add-in is created on .NET 3.51, and the converted project is NOT lifted

    to .NET 4.0, since there is too many changed made in the interfaces between Office components and .NET framework. Ribbon handling for one.

    After converting, the project compiles OK, but if I start it, Word is loaded and en error message is displayed which says (Translated):
    "Couldn't find or load an Add-in". In the error information it says:
    Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateCustomizationDomainException....
    The error code is 0x80131047

    How can I resolve this. The references in the project all looks fine (no errors are shown)

    Thanks.


    Best Regards Peter Karlström Midrange AB, Sweden

    Tuesday, February 14, 2012 9:13 AM
  • Wrong thread perhaps?
    Tuesday, February 14, 2012 9:27 AM
  • Would you try to repair VSTO runtime?  There's a known issue if .NET35 installed after VSTOR, and the article:

    http://support.microsoft.com/kb/2022441

    Best Regards,


    Forrest Guo | MSDN Community Support | Feedback to us

    Wednesday, February 15, 2012 8:29 AM
    Moderator
  • Hi

    Problem solved.

    The project involved a 32-bit not selfRegistrated DLL which came in conflict with the demands on compiling the project with AnyCPU in order to get it to work in a 64-bit Office application.

    After removing and replacing the functionality in the 3rd party DLL all works as expected.

    Thanks anyway for all input in this.


    Best Regards Peter Karlström Midrange AB, Sweden

    Tuesday, February 21, 2012 5:23 PM
  • Great! Glad to hear you got this resolved and thanks for sharing your experience~

    Good day,


    Calvin Gao[MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, February 22, 2012 6:54 AM
    Moderator