none
Code Contracts and VS 11 Beta - 'StanPackage' did not load correctly error

    Question

  • Hi,

    after installing Code Contracts 1.4.50327.0 when opening a solutipon in VS 11 Professional Beta I get the following Visual Studio dialog box:

        'StanPackage' did not load correctly error ...

    ActivityLog.xml contains the following error entry:

    544 ERROR Failed to set up ClassFactory for packageFailed to set up ClassFactory for package
              C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies\stanpackage.dll {72391CE3-743A-4A55-8927-4217541F6517} 80040111 VisualStudio 2012/03/30 06:48:18.424

    Opening the Code Analysis properties then sometimes crashes Visual Studio (there was no problem before installing Code Contracts).

    Wilhelm

    vendredi 30 mars 2012 07:10

Réponses

  • Okay! We just put out a new release (v1.4.50910.0) that should fix this problem. Please install it (and do *not* manually execute "devenv /setup", that should now happen as part of the installation --- which makes it take longer) and let us know if it doesn't work.

    Mike Barnett

    mercredi 12 septembre 2012 16:32

Toutes les réponses

  • Did you try running "devenv /setup" from a Developer Command prompt?  If that doesn't work, try repairing your VS11 install.

    mercredi 4 avril 2012 00:42
  • We'll be looking into this to see if we can determine what's going wrong and get a fix prepared. 

    Thank you very much for providing this feedback.  Very much appreciated.


    Allen Denver - Visual Studio Development

    mercredi 11 avril 2012 16:23
  • I tried both "devenv /setup" and "VS11 Repair" - but both did not work.

    I did the installation with the following sequence:

    • Windows 7 64 bit
    • Visual Studio 2010 Professional
    • Code Contracts 1.4.50126.1
    • Visual Studio 11 Professional Beta
    • Visual Studio 11 Repair to get Code Contracts 1.4.50126.1 running
    • Code Contracts 1.4.50327.0

    jeudi 12 avril 2012 08:08
  • I don't know if this is significant, but I had to run "devenv /setup" from an admin command prompt for it to work without displaying an error.

    Unfortunately, even after that I don't see any Code Contracts tab in project properties.

    vendredi 13 avril 2012 08:17
  • Update: This is now working for me.

    I had to uninstall Code Contracts and then reinstall it, and then run "devenv /setup" from an admin devstudio prompt.

    lundi 16 avril 2012 09:06
  • Wilhelm,

    Can you get the same good behavior as Matthew if you uninstall/reinstall Code Contracts and then run 'devenv /setup' from an elevated VS cmd prompt?


    Allen Denver - Visual Studio Development

    lundi 16 avril 2012 15:28
  • Allen,

    already tried uninstall/reinstall Code Contracts and then 'devenv /setup' without any success.

    mardi 17 avril 2012 07:13
  • The same problem for me. I tried to reinstall code contracts, repair VS, reran devenv /setup with no success

    mercredi 25 avril 2012 13:04
  • I still get the same message after installing to Visual Studio 2012 Release Candidate

    mercredi 6 juin 2012 07:51
  • Wilhelm,

    Can you provide detailed repro steps so we can try to repro this ourselves?


    Allen Denver - Visual Studio Development

    mercredi 6 juin 2012 16:09
  • I tried to reproduce it on a virtual machine - but failed.

    So maybe if one does a clean installation the problem is solved.

    mardi 12 juin 2012 14:57
  • We've been trying to reproduce this using various combinations of SKUs and install steps but have been so far unable to reproduce the issue.  If we can get more detailed install steps, that would help to improve the chance we can reproduce this internally.

    Finally, if someone can debug VS (attach to DevEnv.exe just before the point of the crash) and get a call stack or a dumpfile, that would also help tremendously.

    Thanks!


    Allen Denver - Visual Studio Development

    mardi 12 juin 2012 20:13
  • How about this? )
    (Sorry about Russian in Message, hope this is not important)

    System.AccessViolationException не обработано
      HResult=-2147467261
      Message=Попытка чтения или записи в защищенную память. Это часто свидетельствует о том, что другая память повреждена.
      Source=StanPackage
      StackTrace:
           в CPackage.GetServiceProvider(CPackage* )
           в CVSRuleSelectionPage.{ctor}(CVSRuleSelectionPage* , IUnknown* pOuterUnknown, Int32 )
           в TNL.COM.CreateCoClassInstance<class CVSRuleSelectionPage>(IUnknown* pOuterUnknown, _GUID* iid, Void** ppObject)
           в Microsoft.VisualStudio.Shell.Interop.ILocalRegistry.CreateInstance(Guid clsid, Object punkOuter, Guid& riid, UInt32 dwFlags, IntPtr& ppvObj)
           в Microsoft.VisualStudio.Editors.ApplicationDesigner.PropertyPageInfo.TryLoadPropertyPage()
           в Microsoft.VisualStudio.Editors.ApplicationDesigner.ApplicationDesignerView.ShowTab(Int32 Index, Boolean ForceShow)
           в Microsoft.VisualStudio.Editors.ApplicationDesigner.ApplicationDesignerView.OnInitializationComplete()
           в Microsoft.VisualStudio.Editors.ApplicationDesigner.ApplicationDesignerWindowPane.PopulateView(Guid guidLogicalView)
           в Microsoft.VisualStudio.Editors.ApplicationDesigner.ApplicationDesignerWindowPane.ActivateLogicalView(Guid& rguidLogicalView)
           в Microsoft.VisualStudio.Shell.Interop.IVsUIDataSource.Invoke(String verb, Object pvaIn, Object& pvaOut)
           в Microsoft.Internal.VisualStudio.PlatformUI.DataSource.Invoke(String verb, Object pvaIn, Object& pvaOut)
           в Microsoft.VisualStudio.PlatformUI.VsCommand.Execute(Object parameter)
           в MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
           в System.Windows.Controls.MenuItem.InvokeClickAfterRender(Object arg)
           в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
           в MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
           в System.Windows.Threading.DispatcherOperation.InvokeImpl()
           в System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
           в System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
           в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
           в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           в System.Windows.Threading.DispatcherOperation.Invoke()
           в System.Windows.Threading.Dispatcher.ProcessQueue()
           в System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
           в MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
           в MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
           в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
           в MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
           в System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
           в MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
           в Microsoft.VisualStudio.PlatformUI.NativeMethods.DispatchMessage(MSG& lpmsg)
           в Microsoft.VisualStudio.Platform.WindowManagement.WindowManagerService.<PushMessageLoopOnContextMenuTrackingComponent>b__69(Object sender, PreTranslateMessageEventArgs args)
           в Microsoft.VisualStudio.PlatformUI.OleComponentSupport.OleComponent.FPreTranslateMessageCore(MSG[] pMsg)
           в Microsoft.VisualStudio.PlatformUI.OleComponentSupport.OleComponent.Microsoft.VisualStudio.OLE.Interop.IOleComponent.FPreTranslateMessage(MSG[] pMsg)
           в Microsoft.VisualStudio.OLE.Interop.IOleComponentManager.FPushMessageLoop(UInt32 dwComponentID, UInt32 uReason, IntPtr pvLoopData)
           в Microsoft.VisualStudio.Platform.WindowManagement.WindowManagerService.PushMessageLoopOnContextMenuTrackingComponent()
           в Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy.ExecCommand(UInt32 itemid, Guid& pguidCmdGroup, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
           в Microsoft.Internal.VisualStudio.PlatformUI.HierarchyUtilities.<>c__DisplayClass22.<ExecHierParentChain>b__1f()
           в Microsoft.VisualStudio.ErrorHandler.CallWithCOMConvention(Func`1 method, Boolean reportError)
           в Microsoft.Internal.VisualStudio.PlatformUI.HierarchyUtilities.ExecHierParentChain(IVsHierarchyItemManager manager, IVsUIHierarchy lpUIHCmd, IVsUIHierarchy lpUIHCurrent, UInt32 itemidCurrent, Guid& pguidCmdGroupRef, UInt32 nCmdID, UInt32 nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
           в Microsoft.VisualStudio.PlatformUI.HierarchyItem.HierarchyContextMenuController.ShowContextMenu(IEnumerable`1 items, Point location)
           в Microsoft.Internal.VisualStudio.PlatformUI.ContextMenuController.ShowContextMenu(IEnumerable`1 items, Point location, Func`2 getController)
           в Microsoft.Internal.VisualStudio.PlatformUI.ContextMenuController.ShowContextMenu(IEnumerable`1 items, Point location)
           в Microsoft.Internal.VisualStudio.PlatformUI.PivotTreeView.OnContextMenuOpening(ContextMenuEventArgs e)
           в System.Windows.FrameworkElement.OnContextMenuOpeningThunk(Object sender, ContextMenuEventArgs e)
           в System.Windows.Controls.ContextMenuEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
           в System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
           в System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
           в System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
           в System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
           в System.Windows.ContentElement.RaiseTrustedEvent(RoutedEventArgs args)
           в System.Windows.ContentElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
           в System.Windows.Controls.PopupControlService.RaiseContextMenuOpeningEvent(IInputElement source, Double x, Double y, Boolean userInitiated)
           в System.Windows.Controls.PopupControlService.ProcessMouseUp(Object sender, MouseButtonEventArgs e)
           в System.Windows.Controls.PopupControlService.OnPostProcessInput(Object sender, ProcessInputEventArgs e)
           в System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(ProcessInputEventHandler postProcessInput, ProcessInputEventArgs processInputEventArgs)
           в System.Windows.Input.InputManager.ProcessStagingArea()
           в System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
           в System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
           в System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
           в System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
           в System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
           в MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
           в MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
           в System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
           в MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
           в System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
           в MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
      InnerException:

    mardi 12 juin 2012 20:38
  • Maxim, what build of VS are you using?  Does the problem go away if you first open the Code Analysis Results tool window (using the command from the View / Other Windows / Code Analysis menu)?

    Thanks,


    Allen Denver - Visual Studio Development

    mardi 12 juin 2012 20:47
  • Yes! It works! Thank you
    mardi 12 juin 2012 21:03
  • Glad it works, but can you tell me what version of VS you are having this problem with?  We fixed this after the Beta release so I don't expect it to occur in later releases.

    Thanks!


    Allen Denver - Visual Studio Development

    mardi 12 juin 2012 21:20
  • Version 11.0.50522.1 RCREL
    mardi 12 juin 2012 21:26
  • Opening the Code Analysis window did not worked for me

    Version 11.0.50706..0.QRELRC July 2012


    • Modifié Boucmed vendredi 20 juillet 2012 09:35
    vendredi 20 juillet 2012 09:34
  • I've got the same error showing with 11.0.50706.0 QRELRC July 2012. Opening the CA window does not help.

    At first, I was not able to get the CC tab to VS2012 (the error did not show then), but today I've made it work and the error started to appear.

    I have VS2010 and VS2012 RC installed side-by-side.

    lundi 23 juillet 2012 05:33
  • The issue is present in VS 2012 RTM Ultimate also.
    jeudi 23 août 2012 11:56
  • On my system:

    Clean install of Windows 8 Pro

    - Installed Visual Studio 2010 Ultimate + SP1 + all MS updates

    - Installed Visual Studio 2012 Ultimate

    - Installed Code Contract 1.4.50813.1

    - Executed devenv.exe/setup from a VS 2012 command prompt with admin rights.

    Code Contracts tab is visible and didn't see the "stan-package" problem. With VS 2012RC and previous version of CC I also got "stan-package" warning on my dev system at home and work.

    jeudi 23 août 2012 19:35
  • Interesting, since my work machine had got a VS 2012 Ultimate also on last week, and there was no cry for Stan (who is Stan anyway?). I'm having Windows 7 in my office, and I had VS 2010 installed before 2012. On my home computer, which is a Win8, I had a clean install, and no VS 2010 before, and Stan is needed. Maybe it is related that if we don't have VS 2010 the new studio is gonna cry for Stan.

    jeudi 30 août 2012 08:28
  • The issue is present in VS 2012 RTM Ultimate also.

    Have tha same issue (VS2010 sp1 and VS2012 rtm are installed side-by-side) . 'Code Analisys' tab stops working after CC installation:' An error occurred trying to load the page.984ae51a-4b21-44e7-822c-dd5e046893ef'.

    Even after uninstallation of CC 'stan-package error' appears(however 'Code Analisys' tab starts working).

    VS2010 sp1 works perfect.  CC version 1.4.50813.1. 'Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe /setup' does not help.

    samedi 1 septembre 2012 11:35
  • Do you know what locale your machine is set to? We have identified what we think is the problem and it seems to be related to that. We are testing out a fix and hope to have a new release in the next couple of days.


    Mike Barnett

    lundi 3 septembre 2012 02:37
  • Hello Mike,

    System locale is Russian(Russia), format is English(Australia).



    Nikita Govorov


    mardi 4 septembre 2012 11:19
  • My System locale is German(Austria)

    Running VS 2012 Professional (RTM) on Windows 8 Professional 64 bit (RTM)

    No VS 2010 installed

    StanPackage load error stil occurs

    Wilhelm

    mercredi 5 septembre 2012 12:45
  • Okay, that confirms what we thought was the problem. We have fixed it and are in the process of testing it internally before we publish it. It should just be another day or two.

    Sorry for the problems!


    Mike Barnett

    vendredi 7 septembre 2012 03:28
  • Cool, thanks. Look forward to testing new version.

    Nik Govorov

    vendredi 7 septembre 2012 10:36
  • Thanks!

    I've got it working on my windows 7 machine  - but fails on my windows 8 (Swedish locale) - so I really hope your next release will make me migrate my customer project onto windows 8 :)

    Thanks!

    samedi 8 septembre 2012 07:18
  • Hi,

    I am having the same problem with windows 8 enterprise and studio 2012 premium. (uk edition).

    I hope there is a fix soon.

    dimanche 9 septembre 2012 16:17
  • It's Hungarian.
    mardi 11 septembre 2012 06:26
  • Okay! We just put out a new release (v1.4.50910.0) that should fix this problem. Please install it (and do *not* manually execute "devenv /setup", that should now happen as part of the installation --- which makes it take longer) and let us know if it doesn't work.

    Mike Barnett

    mercredi 12 septembre 2012 16:32
  • That worked like a charm!

    Many thanks

     Mario

    mercredi 12 septembre 2012 22:52
  • Works for me now

    Thanks

    Wilhelm

    jeudi 13 septembre 2012 09:24
  • Works for as well. Thanks.

    Nik Govorov

    vendredi 14 septembre 2012 03:25
  • Works. Thx.
    vendredi 14 septembre 2012 06:37