我上网下载了WebMatrix3 、iis express8

安装以后运行WebMatrix3 报错,日志如下:

System.Collections.Generic.KeyNotFoundException: 要使用的命令不在有效命令列表中。The command being used is not in the list of valid commands.

应用程序: WebMatrix.exe

Framework 版本: v4.0.30319

说明: 由于未经处理的异常,进程终止。

异常信息: System.Collections.Generic.KeyNotFoundException

堆栈:

   在 Microsoft.WebMatrix.Core.CommandManagerImplementation.get_Item(Microsoft.WebMatrix.Core.CommandId)

   在 Microsoft.WebMatrix.Core.StartPageViewModel.InitializeNewMenu()

   在 Microsoft.WebMatrix.Core.StartPageViewModel.InitializeButtonViewModels()

   在 Microsoft.WebMatrix.Core.StartPageViewModel..ctor(System.IServiceProvider)

   在 Microsoft.WebMatrix.Core.StartPage..ctor(System.IServiceProvider)

   在 Microsoft.WebMatrix.Core.ShellMainWPF.OnShellMainWPFLoaded(System.Object, System.Windows.RoutedEventArgs)

   在 System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)

   在 System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)

   在 System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)

   在 System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs)

   在 System.Windows.BroadcastEventHelper.BroadcastEvent(System.Windows.DependencyObject, System.Windows.RoutedEvent)

   在 System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(System.Object)

   在 MS.Internal.LoadedOrUnloadedOperation.DoWork()

   在 System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()

   在 System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()

   在 System.Windows.Media.MediaContext.RenderMessageHandlerCore(System.Object)

   在 System.Windows.Media.MediaContext.RenderMessageHandler(System.Object)

   在 System.Windows.Media.MediaContext.Resize(System.Windows.Media.ICompositionTarget)

   在 System.Windows.Interop.HwndTarget.OnResize()

   在 System.Windows.Interop.HwndTarget.HandleMessage(MS.Internal.Interop.WindowMessage, IntPtr, IntPtr)

   在 System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)

   在 MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)

   在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)

   在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)

   在 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)

   在 System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)

   在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)

   在 MS.Win32.UnsafeNativeMethods.CallWindowProc(IntPtr, IntPtr, Int32, IntPtr, IntPtr)

   在 MS.Win32.HwndSubclass.DefWndProcWrapper(IntPtr, Int32, IntPtr, IntPtr)

   在 MS.Win32.UnsafeNativeMethods.CallWindowProc(IntPtr, IntPtr, Int32, IntPtr, IntPtr)

   在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)

   在 Standard.NativeMethods._SetWindowRgn(IntPtr, IntPtr, Boolean)

   在 Standard.NativeMethods.SetWindowRgn(IntPtr, IntPtr, Boolean)

   在 Microsoft.Windows.Shell.WindowChromeWorker._ClearRoundingRegion()

   在 Microsoft.Windows.Shell.WindowChromeWorker._UpdateFrameState(Boolean)

   在 Microsoft.Windows.Shell.WindowChromeWorker._ApplyNewCustomChrome()

   在 Microsoft.Windows.Shell.WindowChromeWorker.<_SetWindow>b__1(System.Object, System.EventArgs)

   在 System.Windows.Window.OnSourceInitialized(System.EventArgs)

   在 System.Windows.Window.CreateSourceWindow(Boolean)

   在 System.Windows.Window.CreateSourceWindowDuringShow()

   在 System.Windows.Window.SafeCreateWindowDuringShow()

   在 System.Windows.Window.ShowHelper(System.Object)

   在 System.Windows.Window.Show()

   在 System.Windows.Application.b__f(System.Object)

   在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)

   在 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)

   在 System.Windows.Threading.DispatcherOperation.InvokeImpl()

   在 System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)

   在 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

   在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

   在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)

   在 System.Windows.Threading.DispatcherOperation.Invoke()

   在 System.Windows.Threading.Dispatcher.ProcessQueue()

   在 System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)

   在 MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)

   在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)

   在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)

   在 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)

   在 System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)

   在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)

   在 MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)

   在 System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)

   在 System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)

   在 System.Windows.Threading.Dispatcher.Run()

   在 System.Windows.Application.RunDispatcher(System.Object)

   在 System.Windows.Application.RunInternal(System.Windows.Window)

   在 System.Windows.Application.Run(System.Windows.Window)

   在 Microsoft.WebMatrix.Core.WebMatrixShellApplication.Execute(Boolean, Boolean, Boolean, Boolean)

   在 Microsoft.WebMatrix.Core.ShellApplicationHelper.Execute(StartupFlags)

   在 Microsoft.WebMatrix.Core.ShellApplicationHelper.Execute()

   在 Microsoft.WebMatrix.EntryPoint.Main(System.String[])

--------

2015/3/30 16:27:17

--------

System.Collections.Generic.KeyNotFoundException: 要使用的命令不在有效命令列表中。

   在 Microsoft.WebMatrix.Core.CommandManagerImplementation.get_Item(CommandId id)

   在 Microsoft.WebMatrix.Core.StartPageViewModel.InitializeNewMenu()

   在 Microsoft.WebMatrix.Core.StartPageViewModel.InitializeButtonViewModels()

   在 Microsoft.WebMatrix.Core.StartPageViewModel..ctor(IServiceProvider serviceProvider)

   在 Microsoft.WebMatrix.Core.StartPage..ctor(IServiceProvider serviceProvider)

   在 Microsoft.WebMatrix.Core.ShellMainWPF.OnShellMainWPFLoaded(Object sender, RoutedEventArgs e)

   在 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.UIElement.RaiseEvent(RoutedEventArgs e)

   在 System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)

   在 System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)

   在 MS.Internal.LoadedOrUnloadedOperation.DoWork()

   在 System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()

   在 System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()

   在 System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)

   在 System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)

   在 System.Windows.Media.MediaContext.Resize(ICompositionTarget resizedCompositionTarget)

   在 System.Windows.Interop.HwndTarget.OnResize()

   在 System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)

   在 System.Windows.Interop.HwndSource.HwndTargetFilterMessage(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)

问题原因:你是直接安装没有使用Microsoft Web Platform Installer,自行安装少了很多依赖项。

不同版本的WebMatrix3 所需依赖组件不同,今天下载WebMatrix3 对应Microsoft Web Platform V5.0

需要安装下列组件:(64位系统为例,32位系统不用装标有x64的组件)

Microsoft SQL Server 2012 Transact-SQL ScriptDom

Microsoft SQL Server 2012 Data-Tier Application Framework 11.0 x86(2012 年 4 月)

Microsoft SQL Server 2012 Data-Tier Application Framework 11.0 x64(2012 年 4 月)

Microsoft WebMatrix 3

Microsoft System CLR Types for Microsoft SQL Server 2012 (x64)

Microsoft System CLR Types for Microsoft SQL Server 2012 (x86)

Web Deploy 3.0 - 2012 年 7 月

 这些组件可以自行去微软下载中心搜索安装,也可以直接装visual studio express 2012/2013解决。

visual studio express 2012/2013 或者sqlserver 2012 express共用。

测试系统(全部是笔记自带原装系统):

windows 8 中文版(64位)

windows 7 家庭版(32位)