Предоставление значения для system windows baml2006 typeconvertermarkupextension вызвало исключение

Как перейти от Waterfall к Agile

EggHead 06.05.2025

Каскадная модель разработки Waterfall — классический пример того, как благие намерения превращаются в организационный кошмар. Изначально созданная для упорядочивания хаоса и внесения предсказуемости. . .

Оптимизация SQL запросов — Продвинутые техники

Codd 06.05.2025

Интересно наблюдать эволюцию подходов к оптимизации. Двадцать лет назад всё сводилось к нескольким простым правилам: «Избегайте SELECT *», «Используйте индексы», «Не джойните слишком много таблиц». . . .

Создание микросервисов с gRPC и Protobuf в C++

bytestream 06.05.2025

Монолитные приложения, которые ещё недавно считались стандартом индустрии, уступают место микросервисной архитектуре — подходу, при котором система разбивается на небольшие автономные сервисы, каждый. . .

Многопоточность и параллелизм в Python: потоки, процессы и гринлеты

py-thonny 06.05.2025

Параллелизм и конкурентность — две стороны многопоточной медали, которые постоянно путают даже бывалые разработчики.

Конкурентность (concurrency) — это когда ваша программа умеет жонглировать. . .

Распределенное обучение с TensorFlow и Python

AI_Generated 06.05.2025

В машинном обучении размер имеет значение. С ростом сложности моделей и объема данных одиночный процессор или даже мощная видеокарта уже не справляются с задачей обучения за разумное время. Когда. . .

CRUD API на C# и GraphQL

stackOverflow 06.05.2025

В бэкенд-разработке постоянно возникают новые технологии, призванные решить актуальные проблемы и упростить жизнь программистам. Одной из таких технологий стал GraphQL — язык запросов для API,. . .

Распознавание голоса и речи на C#

UnmanagedCoder 05.05.2025

Интеграция голосового управления в приложения на C# стала намного доступнее благодаря развитию специализированных библиотек и API. При этом многие разработчики до сих пор считают голосовое управление. . .

Реализация своих итераторов в C++

NullReferenced 05.05.2025

Итераторы в C++ — это абстракция, которая связывает весь экосистему Стандартной Библиотеки Шаблонов (STL) в единое целое, позволяя алгоритмам работать с разнородными структурами данных без знания их. . .

Разработка собственного фреймворка для тестирования в C#

UnmanagedCoder 05.05.2025

C# довольно богат готовыми решениями – NUnit, xUnit, MSTest уже давно стали своеобразными динозаврами индустрии. Однако, как и любой динозавр, они не всегда могут протиснуться в узкие коридоры. . .

Распределенная трассировка в Java с помощью OpenTelemetry

Javaican 05.05.2025

Микросервисная архитектура стала краеугольным камнем современной разработки, но вместе с ней пришла и головная боль, знакомая многим — отслеживание прохождения запросов через лабиринт взаимосвязанных. . .

Received the exception below when trying to create a simple splash screen. Not sure if I am missing something, but I basically copied the markup provided in the intro. Markup and exception are included.


A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll

Additional information: 'Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '9' and line position '10'.

<Window x:Class="DemoApp.SplashScreen"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:gif="http://wpfanimatedgif.codeplex.com"
        Title="SplashScreen" Height="300" Width="300"
        ResizeMode="NoResize" WindowStyle="None"   
        WindowStartupLocation="CenterScreen" Background="white" BorderThickness="5" BorderBrush="LightGray" Topmost="True">
    <Grid Height="290" VerticalAlignment="Top">
        <Image gif:ImageBehavior.AnimatedSource="Images/loading.gif" />
    </Grid>
</Window>

Sometimes it blows me away to see an error message that is so confusing that I don’t wonder why people get frustrated with new technology. Take for instance this error you might see when building a WPF application. I had a WPF application that I was polishing and happened to add a background to a report page. It took me several minutes to determine what the problem was because, as you can see, the error didn’t really indicate clearly what the problem was.
The root cause was that when I added the Grid.Background, I had not provided a path and the file was in the solution directory, so it looked fine during design but failed when I tried to run the application.
The fix was simple, I put the file on a hosted share and gave a web URL for the image.

I hope that helps someone avoid the headache I had.

** One additional note ** Changing the target framework to 3.5 clarified the error greatly. Kudos to the 3.5 .Net guys. ***

Happy Coding!

About JohnHowell

I am a professional software developer with over 20 years of experience. I currently specialize in Microsoft technologies such as VS, TFS, C#, VB.Net, WCF, WPF, WW, etc.

Whoops! Sorry about that, I thought I had hit the submit button.

First, I want to thank Jeremy Clark @ Firetrust Support for helping me to diagnose where the problem might be coming from. Without his help, I probably would have still been stumbling around.

FastPictureViewerPro and WPF don’t play nicely together. This also manifests Itself as a conflict with the programs «FastPictureViewerPro»(FPV) & «FastPictureViewer Codec Pack» from Axel Rietschin Software Developments (found here: http://www.fastpictureviewer.com/) and MailWasherPro. Even though they are a Microsoft Registered Partner, there is a conflict in how Windows Presentation Foundation (or WPF) is handled. WPF is a computer-software graphical subsystem for rendering user interfaces in Windows-based applications. It utilizes DirectX and was introduced as part of .NET with release 3.0. When either of the FPV programs are installed, the current versions hijack the system calls for the graphics subsystem. Anytime .NET is updated, a corruption occurs as to what graphics hooks are assigned to which programs. This explains why «Calculator» would cease to display properly, in addition to many other programs, including WPF.

Long story short, I uninstalled FPV Pro and the situation was resolved.
FPV is a very useful program, so please don’t get the impression that I am bashing them. Once they resolve their programming issue, I will probably install it again.

JC

---------------------------

---------------------------
System.Windows.Markup.XamlParseException: "Предоставление значения для "System.Windows.Baml2006.TypeConverterMarkupExtension" вызвало исключение.": номер строки "5" и позиция в строке "38". ---> System.IO.FileFormatException: Формат изображения не распознан. ---> System.Runtime.InteropServices.COMException: Исключение из HRESULT: 0x88982F07

   --- Конец трассировки внутреннего стека исключений ---

   в System.Windows.Media.PixelFormat.GetPixelFormat(SafeMILHandle bitmapSource)

   в System.Windows.Media.Imaging.BitmapSource.UpdateCachedSettings()

   в System.Windows.Media.Imaging.BitmapSource.set_WicSourceHandle(BitmapSourceSafeMILHandle value)

   в System.Windows.Media.Imaging.BitmapFrameDecode.FinalizeCreation()

   в System.Windows.Media.Imaging.BitmapSource.CompleteDelayedCreation()

   в System.Windows.Media.Imaging.BitmapSource.get_WicSourceHandle()

   в System.Windows.Media.Imaging.BitmapFrameDecode..ctor(Int32 frameNumber, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, BitmapFrameDecode frameDecode)

   в System.Windows.Media.Imaging.BitmapDecoder.SetupFrames(BitmapDecoder decoder, ReadOnlyCollection`1 frames)

   в System.Windows.Media.Imaging.BitmapDecoder.Initialize(BitmapDecoder decoder)

   в System.Windows.Media.Imaging.BitmapDecoder..ctor(SafeMILHandle decoderHandle, BitmapDecoder decoder, Uri baseUri, Uri uri, Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, Boolean insertInDecoderCache, Boolean isOriginalWritable, Stream uriStream, UnmanagedMemoryStream unmanagedMemoryStream, SafeFileHandle safeFilehandle)

   в System.Windows.Media.Imaging.IconBitmapDecoder..ctor(SafeMILHandle decoderHandle, BitmapDecoder decoder, Uri baseUri, Uri uri, Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, Boolean insertInDecoderCache, Boolean originalWritable, Stream uriStream, UnmanagedMemoryStream unmanagedMemoryStream, SafeFileHandle safeFilehandle)

   в System.Windows.Media.Imaging.BitmapDecoder.CreateFromUriOrStream(Uri baseUri, Uri uri, Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, RequestCachePolicy uriCachePolicy, Boolean insertInDecoderCache)

   в System.Windows.Media.Imaging.BitmapFrame.CreateFromUriOrStream(Uri baseUri, Uri uri, Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, RequestCachePolicy uriCachePolicy)

   в System.Windows.Media.ImageSourceConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)

   в System.Windows.Baml2006.TypeConverterMarkupExtension.ProvideValue(IServiceProvider serviceProvider)

   в MS.Internal.Xaml.Runtime.ClrObjectRuntime.CallProvideValue(MarkupExtension me, IServiceProvider serviceProvider)

   --- Конец трассировки внутреннего стека исключений ---

   в System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)

   в System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)

   в System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)

   в System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)

   в System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)

   в SampleAlfaCandles.ChartWindow.InitializeComponent() в f:\Sources\Codeplex\StockSharpReleases\StockSharp_4.0.1\Samples\AlfaDirect\SampleAlfaCandles\ChartWindow.xaml:строка 1

   в SampleAlfaCandles.ChartWindow..ctor() в F:\Sources\Codeplex\StockSharpReleases\StockSharp_4.0.1\Samples\AlfaDirect\SampleAlfaCandles\ChartWindow.xaml.cs:строка 13

   в SampleAlfaCandles.MainWindow.ShowChartClick(Object sender, RoutedEventArgs e) в F:\Sources\Codeplex\StockSharpReleases\StockSharp_4.0.1\Samples\AlfaDirect\SampleAlfaCandles\MainWindow.xaml.cs:строка 124

   в 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.Controls.Primitives.ButtonBase.OnClick()

   в System.Windows.Controls.Button.OnClick()

   в System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)

   в System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)

   в System.Windows.Input.MouseButtonEventArgs.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.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)

   в System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)

   в System.Windows.Input.MouseButtonEventArgs.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.UIElement.RaiseTrustedEvent(RoutedEventArgs args)

   в System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)

   в 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)
---------------------------
ОК   
---------------------------

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Антивирус для windows 10 адгуард
  • Центр обновления windows 10 корпоративная
  • Как удалить центр сертификации windows server
  • Как проверить соответствует ли компьютер windows 11
  • Как отключить уведомление windows smartscreen