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

    問題

  • 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

    2012年3月30日 上午 07:10

解答

  • 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

    2012年9月12日 下午 04:32

所有回覆

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

    2012年4月4日 上午 12: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

    2012年4月11日 下午 04: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

    2012年4月12日 上午 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.

    2012年4月13日 上午 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.

    2012年4月16日 上午 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

    2012年4月16日 下午 03:28
  • Allen,

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

    2012年4月17日 上午 07:13
  • The same problem for me. I tried to reinstall code contracts, repair VS, reran devenv /setup with no success

    2012年4月25日 下午 01:04
  • I still get the same message after installing to Visual Studio 2012 Release Candidate

    2012年6月6日 上午 07:51
  • Wilhelm,

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


    Allen Denver - Visual Studio Development

    2012年6月6日 下午 04:09
  • I tried to reproduce it on a virtual machine - but failed.

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

    2012年6月12日 下午 02: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

    2012年6月12日 下午 08: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:

    2012年6月12日 下午 08: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

    2012年6月12日 下午 08:47
  • Yes! It works! Thank you
    2012年6月12日 下午 09: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

    2012年6月12日 下午 09:20
  • Version 11.0.50522.1 RCREL
    2012年6月12日 下午 09:26
  • Opening the Code Analysis window did not worked for me

    Version 11.0.50706..0.QRELRC July 2012


    • 已編輯 Boucmed 2012年7月20日 上午 09:35
    2012年7月20日 上午 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.

    2012年7月23日 上午 05:33
  • The issue is present in VS 2012 RTM Ultimate also.
    2012年8月23日 上午 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.

    2012年8月23日 下午 07: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.

    2012年8月30日 上午 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.

    2012年9月1日 上午 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

    2012年9月3日 上午 02:37
  • Hello Mike,

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



    Nikita Govorov


    2012年9月4日 上午 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

    2012年9月5日 下午 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

    2012年9月7日 上午 03:28
  • Cool, thanks. Look forward to testing new version.

    Nik Govorov

    2012年9月7日 上午 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!

    2012年9月8日 上午 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.

    2012年9月9日 下午 04:17
  • It's Hungarian.
    2012年9月11日 上午 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

    2012年9月12日 下午 04:32
  • That worked like a charm!

    Many thanks

     Mario

    2012年9月12日 下午 10:52
  • Works for me now

    Thanks

    Wilhelm

    2012年9月13日 上午 09:24
  • Works for as well. Thanks.

    Nik Govorov

    2012年9月14日 上午 03:25
  • Works. Thx.
    2012年9月14日 上午 06:37