我收到了例外:
抛出异常:' System.Resources.MissingManifestResourceException' 在mscorlib.dll中其他信息:找不到任何资源 适合特定的文化或中性文化。使 肯定" Arction.WPF.LightningChartUltimate.g.resources"是正确的 嵌入或链接到汇编" Arction.WPF.LightningChartUltimate" 在编译时,或所需的所有附属程序集都是 可加载和完全签名。
当我尝试使用所选对象从WpfToolkit-PropertyGrid扩展节点时发生异常:LightningChartUltimate。问题来自两个属性,即" enum"。如果我阻止将两个枚举作为属性从propertyGrid处理,一切都很好,不再例外。
当我查看堆栈时,我发现WPF正在寻找文件:" themes \ generic.baml"。
有人知道问题的根源吗?
作为附加信息(2015-11-17):我已经使用其他应用进行了测试 这给了我一个不同的行为,它不搜索themes / generic.baml。但这两个应用程序给了我相同的结果:
我的主要应用:
- Debug.Print(Thread.CurrentThread.CurrentCulture.ToString()); = fr-CA
- Debug.Print(Thread.CurrentThread.CurrentUICulture.ToString()); = en-US
我的小测试应用程序:
- Debug.Print(Thread.CurrentThread.CurrentCulture.ToString()); = fr-CA
- Debug.Print(Thread.CurrentThread.CurrentUICulture.ToString()); = en-US
堆栈仅由Microsoft代码组成:
mscorlib.dll!System.Resources.ManifestBasedResourceGroveler.HandleResourceStreamMissing(string fileName) Unknown
mscorlib.dll!System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(System.Globalization.CultureInfo culture, System.Collections.Generic.Dictionary<string, System.Resources.ResourceSet> localResourceSets, bool tryParents, bool createIfNotExists, ref System.Threading.StackCrawlMark stackMark) Unknown
mscorlib.dll!System.Resources.ResourceManager.InternalGetResourceSet(System.Globalization.CultureInfo requestedCulture, bool createIfNotExists, bool tryParents, ref System.Threading.StackCrawlMark stackMark) Unknown
mscorlib.dll!System.Resources.ResourceManager.InternalGetResourceSet(System.Globalization.CultureInfo culture, bool createIfNotExists, bool tryParents) Unknown
mscorlib.dll!System.Resources.ResourceManager.GetObject(string name, System.Globalization.CultureInfo culture, bool wrapUnmanagedMemStream) Unknown
mscorlib.dll!System.Resources.ResourceManager.GetStream(string name, System.Globalization.CultureInfo culture) Unknown
> PresentationFramework.dll!System.Windows.SystemResources.ResourceDictionaries.LoadDictionary(System.Reflection.Assembly assembly, string assemblyName, string resourceName, bool isTraceEnabled) Line 775 C#
PresentationFramework.dll!System.Windows.SystemResources.ResourceDictionaries.LoadGenericDictionary(bool isTraceEnabled) Line 637 C#
PresentationFramework.dll!System.Windows.SystemResources.FindDictionaryResource(object key, System.Type typeKey, System.Windows.ResourceKey resourceKey, bool isTraceEnabled, bool allowDeferredResourceReference, bool mustReturnDeferredResourceReference, out bool canCache) Line 316 C#
PresentationFramework.dll!System.Windows.SystemResources.FindResourceInternal(object key, bool allowDeferredResourceReference, bool mustReturnDeferredResourceReference) Line 176 C#
PresentationFramework.dll!MS.Internal.Helper.FindTemplateResourceFromAppOrSystem(System.Windows.DependencyObject target, System.Collections.ArrayList keys, int exactMatch, ref int bestMatch) Line 130 C#
PresentationFramework.dll!System.Windows.FrameworkElement.FindTemplateResourceInternal(System.Windows.DependencyObject target, object item, System.Type templateType) Line 1476 C#
PresentationFramework.dll!System.Windows.Controls.ContentPresenter.DefaultSelector.SelectTemplate(object item, System.Windows.DependencyObject container) Line 1156 C#
PresentationFramework.dll!System.Windows.Controls.ContentPresenter.ChooseTemplate() Line 547 C#
PresentationFramework.dll!System.Windows.Controls.ContentPresenter.EnsureTemplate() Line 836 C#
PresentationFramework.dll!System.Windows.Controls.ContentPresenter.OnPreApplyTemplate() Line 480 C#
PresentationFramework.dll!System.Windows.FrameworkElement.ApplyTemplate() Line 356 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4280 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!System.Windows.Controls.Grid.MeasureCell(int cell, bool forceInfinityV) Line 1430 C#
PresentationFramework.dll!System.Windows.Controls.Grid.MeasureCellsGroup(int cellsHead, System.Windows.Size referenceSize, bool ignoreDesiredSizeU, bool forceInfinityV, out bool hasDesiredSizeUChanged) Line 1282 C#
PresentationFramework.dll!System.Windows.Controls.Grid.MeasureCellsGroup(int cellsHead, System.Windows.Size referenceSize, bool ignoreDesiredSizeU, bool forceInfinityV) Line 1245 C#
PresentationFramework.dll!System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size constraint) Line 653 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!System.Windows.Controls.Control.MeasureOverride(System.Windows.Size constraint) Line 712 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!MS.Internal.Helper.MeasureElementWithSingleChild(System.Windows.UIElement element, System.Windows.Size constraint) Line 548 C#
PresentationFramework.dll!System.Windows.Controls.ContentPresenter.MeasureOverride(System.Windows.Size constraint) Line 495 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!System.Windows.Controls.Control.MeasureOverride(System.Windows.Size constraint) Line 712 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!System.Windows.Controls.Border.MeasureOverride(System.Windows.Size constraint) Line 241 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!System.Windows.Controls.Grid.MeasureCell(int cell, bool forceInfinityV) Line 1430 C#
PresentationFramework.dll!System.Windows.Controls.Grid.MeasureCellsGroup(int cellsHead, System.Windows.Size referenceSize, bool ignoreDesiredSizeU, bool forceInfinityV, out bool hasDesiredSizeUChanged) Line 1282 C#
PresentationFramework.dll!System.Windows.Controls.Grid.MeasureCellsGroup(int cellsHead, System.Windows.Size referenceSize, bool ignoreDesiredSizeU, bool forceInfinityV) Line 1245 C#
PresentationFramework.dll!System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size constraint) Line 653 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!System.Windows.Controls.Border.MeasureOverride(System.Windows.Size constraint) Line 241 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!System.Windows.Controls.Control.MeasureOverride(System.Windows.Size constraint) Line 712 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!System.Windows.Controls.VirtualizingStackPanel.MeasureChild(ref System.Windows.Controls.Primitives.IItemContainerGenerator generator, ref System.Windows.Controls.Primitives.IContainItemStorage itemStorageProvider, ref System.Windows.Controls.Primitives.IContainItemStorage parentItemStorageProvider, ref object parentItem, ref bool hasUniformOrAverageContainerSizeBeenSet, ref double computedUniformOrAverageContainerSize, ref bool computedAreContainersUniformlySized, ref System.Collections.IList items, ref object item, ref System.Collections.IList children, ref int childIndex, ref bool visualOrderChanged, ref bool isHorizontal, ref System.Windows.Size childConstraint, ref System.Windows.Rect viewport, ref System.Windows.Controls.VirtualizationCacheLength cacheSize, ref System.Windows.Controls.VirtualizationCacheLengthUnit cacheUnit, ref bool foundFirstItemInViewport, ref double firstItemInViewportOffset, ref System.Windows.Size stackPixelSize, ref System.Windows.Size stackPixelSizeInViewport, ref System.Windows.Size stackPixelSizeInCacheBeforeViewport, ref System.Windows.Size stackPixelSizeInCacheAfterViewport, ref System.Windows.Size stackLogicalSize, ref System.Windows.Size stackLogicalSizeInViewport, ref System.Windows.Size stackLogicalSizeInCacheBeforeViewport, ref System.Windows.Size stackLogicalSizeInCacheAfterViewport, ref bool mustDisableVirtualization, bool isBeforeFirstItem, bool isAfterFirstItem, bool isAfterLastItem, bool skipActualMeasure, bool skipGeneration, ref bool hasBringIntoViewContainerBeenMeasured, ref bool hasVirtualizingChildren) Line 6830 C#
PresentationFramework.dll!System.Windows.Controls.VirtualizingStackPanel.MeasureOverrideImpl(System.Windows.Size constraint, ref double? lastPageSafeOffset, ref System.Collections.Generic.List<double> previouslyMeasuredOffsets, ref double? lastPagePixelSize, bool remeasure) Line 2251 C#
PresentationFramework.dll!System.Windows.Controls.VirtualizingStackPanel.MeasureOverride(System.Windows.Size constraint) Line 1708 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!MS.Internal.Helper.MeasureElementWithSingleChild(System.Windows.UIElement element, System.Windows.Size constraint) Line 548 C#
PresentationFramework.dll!System.Windows.Controls.ItemsPresenter.MeasureOverride(System.Windows.Size constraint) Line 73 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!MS.Internal.Helper.MeasureElementWithSingleChild(System.Windows.UIElement element, System.Windows.Size constraint) Line 548 C#
PresentationFramework.dll!System.Windows.Controls.ContentPresenter.MeasureOverride(System.Windows.Size constraint) Line 495 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!System.Windows.Controls.Border.MeasureOverride(System.Windows.Size constraint) Line 241 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!System.Windows.Controls.Border.MeasureOverride(System.Windows.Size constraint) Line 241 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!System.Windows.Controls.Grid.MeasureCell(int cell, bool forceInfinityV) Line 1430 C#
PresentationFramework.dll!System.Windows.Controls.Grid.MeasureCellsGroup(int cellsHead, System.Windows.Size referenceSize, bool ignoreDesiredSizeU, bool forceInfinityV, out bool hasDesiredSizeUChanged) Line 1282 C#
PresentationFramework.dll!System.Windows.Controls.Grid.MeasureCellsGroup(int cellsHead, System.Windows.Size referenceSize, bool ignoreDesiredSizeU, bool forceInfinityV) Line 1245 C#
PresentationFramework.dll!System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size constraint) Line 653 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!System.Windows.Controls.Control.MeasureOverride(System.Windows.Size constraint) Line 712 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!System.Windows.Controls.Border.MeasureOverride(System.Windows.Size constraint) Line 241 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!System.Windows.Controls.Control.MeasureOverride(System.Windows.Size constraint) Line 712 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!System.Windows.Controls.StackPanel.StackMeasureHelper(System.Windows.Controls.IStackMeasure measureElement, System.Windows.Controls.IStackMeasureScrollData scrollData, System.Windows.Size constraint) Line 584 C#
PresentationFramework.dll!System.Windows.Controls.StackPanel.MeasureOverride(System.Windows.Size constraint) Line 524 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!MS.Internal.Helper.MeasureElementWithSingleChild(System.Windows.UIElement element, System.Windows.Size constraint) Line 548 C#
PresentationFramework.dll!System.Windows.Controls.ItemsPresenter.MeasureOverride(System.Windows.Size constraint) Line 73 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!System.Windows.Controls.Border.MeasureOverride(System.Windows.Size constraint) Line 241 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!System.Windows.Controls.Control.MeasureOverride(System.Windows.Size constraint) Line 712 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!MS.Internal.Helper.MeasureElementWithSingleChild(System.Windows.UIElement element, System.Windows.Size constraint) Line 548 C#
PresentationFramework.dll!System.Windows.Controls.ContentPresenter.MeasureOverride(System.Windows.Size constraint) Line 495 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!System.Windows.Controls.Border.MeasureOverride(System.Windows.Size constraint) Line 241 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!System.Windows.Controls.Border.MeasureOverride(System.Windows.Size constraint) Line 241 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationFramework.dll!System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size constraint) Line 435 C#
PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) Line 4363 C#
PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize) Line 664 C#
PresentationCore.dll!System.Windows.ContextLayoutManager.UpdateLayout() Line 317 C#
PresentationCore.dll!System.Windows.ContextLayoutManager.UpdateLayoutCallback(object arg) Line 589 C#
PresentationCore.dll!System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork() Line 1562 C#
PresentationCore.dll!System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() Line 1949 C#
PresentationCore.dll!System.Windows.Media.MediaContext.RenderMessageHandlerCore(object resizedCompositionTarget) Line 1826 C#
PresentationCore.dll!System.Windows.Media.MediaContext.RenderMessageHandler(object resizedCompositionTarget) Line 1721 C#
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) Line 104 C#
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler) Line 37 C#
WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeImpl() Line 583 C#
WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(object state) Line 528 C#
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
WindowsBase.dll!System.Windows.Threading.DispatcherOperation.Invoke() Line 441 C#
WindowsBase.dll!System.Windows.Threading.Dispatcher.ProcessQueue() Line 2232 C#
WindowsBase.dll!System.Windows.Threading.Dispatcher.WndProcHook(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) Line 2485 C#
WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) Line 341 C#
WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o) Line 494 C#
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) Line 104 C#
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler) Line 37 C#
WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs) Line 1445 C#
WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam) Line 392 C#
[Native to Managed Transition]
[Managed to Native Transition]
WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame) Line 2281 C#
WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame frame) Line 369 C#
PresentationFramework.dll!System.Windows.Application.RunDispatcher(object ignore) Line 2756 C#
PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window) Line 1845 C#
PresentationFramework.dll!System.Windows.Application.Run(System.Windows.Window window) Line 261 C#
PresentationFramework.dll!System.Windows.Application.Run() Line 222 C#
ParametricStudyAnalysis.exe!ParametricStudyAnalysis.App.Main() C#
答案 0 :(得分:1)
Arction.WPF.LightningChartUltimate
在其程序集中不使用任何模板,样式或基于主题的资源。因此,如果程序集正在查找themes\generic.baml
(generic.xaml
的编译版本),那是因为它们的代码必须在其ThemeInfoAttribute
代码文件中包含错误的AssemblyInfo.cs
定义。
在AssemblyInfo.cs文件中验证以下代码:
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.None //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
请确保第二个参数为ResourceDictionaryLocation.None
默认值为ResourceDictionaryLocation.SourceAssembly
,他们可能很容易忘记调整其值。