[GH-ISSUE #917] 'ContentType string is invalid' exception thrown at application startup after upgrading #1703

Closed
opened 2026-02-28 12:06:09 +03:00 by kerem · 4 comments
Owner

Originally created by @az-123-none on GitHub (Apr 22, 2025).
Original GitHub issue: https://github.com/1Remote/1Remote/issues/917

Originally assigned to: @VShawn on GitHub.

Describe the bug
应用在更新后启动会弹出“ContentType 字符串无效。要求的格式为 type/subtype。”错误。

To Reproduce
启动即可触发。

Expected behavior
正常启动使用。

Desktop (please complete the following information):

Environment

Component Version
1Remote(Store) 1.1.2(Built at: 2025-04-09T09:00:23.337+08:00)(Microsoft store)
.NET Framework .NET Framework 4.8
CLR 4.0.30319.42000
OS Windows 10 Pro 64-bits 10.0.19045.0 (2009) build 19045

Additional context

Error Info

ContentType 字符串无效。要求的格式为 type/subtype。

Stack Trace

   在 MS.Internal.ContentType.ParseTypeAndSubType(String typeAndSubType)
   在 MS.Internal.ContentType..ctor(String contentType)
   在 MS.Internal.MimeTypeMapper.GetMimeTypeFromUrlMon(Uri uriSource)
   在 MS.Internal.MimeTypeMapper.GetMimeTypeFromUri(Uri uriSource)
   在 MS.Internal.AppModel.ResourcePart.GetContentTypeCore()
   在 System.IO.Packaging.PackagePart.get_ContentType()
   在 MS.Internal.AppModel.ResourcePart.GetStreamCore(FileMode mode, FileAccess access)
   在 System.IO.Packaging.PackagePart.GetStream(FileMode mode, FileAccess access)
   在 System.Windows.Application.GetResourceStream(Uri uriResource)
   在 _1RM.App.OnStartup(StartupEventArgs e) 位置 D:\DemoProject\1Remote\Ui\App.xaml.cs:行号 82
   在 System.Windows.Application.<.ctor>b__1_0(Object unused)
   在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

另一台没有问题,数据库也从有问题的拷贝过去测试过,没有问题。

Originally created by @az-123-none on GitHub (Apr 22, 2025). Original GitHub issue: https://github.com/1Remote/1Remote/issues/917 Originally assigned to: @VShawn on GitHub. **Describe the bug** 应用在更新后启动会弹出“ContentType 字符串无效。要求的格式为 type/subtype。”错误。 **To Reproduce** 启动即可触发。 **Expected behavior** 正常启动使用。 **Desktop (please complete the following information):** ## Environment | Component | Version | |:------------------|:--------------------------------------| |1Remote(Store) | `1.1.2(Built at: 2025-04-09T09:00:23.337+08:00)`(Microsoft store)| |.NET Framework | `.NET Framework 4.8` | |CLR | `4.0.30319.42000` | |OS | `Windows 10 Pro 64-bits 10.0.19045.0 (2009) build 19045` | **Additional context** ## Error Info ContentType 字符串无效。要求的格式为 type/subtype。 ## Stack Trace ``` 在 MS.Internal.ContentType.ParseTypeAndSubType(String typeAndSubType) 在 MS.Internal.ContentType..ctor(String contentType) 在 MS.Internal.MimeTypeMapper.GetMimeTypeFromUrlMon(Uri uriSource) 在 MS.Internal.MimeTypeMapper.GetMimeTypeFromUri(Uri uriSource) 在 MS.Internal.AppModel.ResourcePart.GetContentTypeCore() 在 System.IO.Packaging.PackagePart.get_ContentType() 在 MS.Internal.AppModel.ResourcePart.GetStreamCore(FileMode mode, FileAccess access) 在 System.IO.Packaging.PackagePart.GetStream(FileMode mode, FileAccess access) 在 System.Windows.Application.GetResourceStream(Uri uriResource) 在 _1RM.App.OnStartup(StartupEventArgs e) 位置 D:\DemoProject\1Remote\Ui\App.xaml.cs:行号 82 在 System.Windows.Application.<.ctor>b__1_0(Object unused) 在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) 在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) ``` 另一台没有问题,数据库也从有问题的拷贝过去测试过,没有问题。
kerem 2026-02-28 12:06:09 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@VShawn commented on GitHub (Apr 23, 2025):

https://github.com/1Remote/1Remote/blob/main/Ui/App.xaml.cs#L81-L88

App.xaml.cs:line 82 is the dummy.wav.Play(), @itagagaki do you have any idea of this? Can try-catch be a hotfix solution for the issue?

<!-- gh-comment-id:2822867610 --> @VShawn commented on GitHub (Apr 23, 2025): https://github.com/1Remote/1Remote/blob/main/Ui/App.xaml.cs#L81-L88 App.xaml.cs:line 82 is the `dummy.wav`.Play(), @itagagaki do you have any idea of this? Can try-catch be a hotfix solution for the issue?
Author
Owner

@itagagaki commented on GitHub (Apr 23, 2025):

I don't know but maybe there is no HKEY_CLASSES_ROOT.wav in the Windows registry?

https://stackoverflow.com/questions/1392754

<!-- gh-comment-id:2824364451 --> @itagagaki commented on GitHub (Apr 23, 2025): I don't know but maybe there is no `HKEY_CLASSES_ROOT.wav` in the Windows registry? https://stackoverflow.com/questions/1392754
Author
Owner

@VShawn commented on GitHub (Apr 23, 2025):

I'm not sure either. anyway I have added the try-catch block and publish a new store release.

<!-- gh-comment-id:2824430885 --> @VShawn commented on GitHub (Apr 23, 2025): I'm not sure either. anyway I have added the try-catch block and publish a new store release.
Author
Owner

@az-123-none commented on GitHub (Apr 24, 2025):

I don't know but maybe there is no HKEY_CLASSES_ROOT.wav in the Windows registry?

https://stackoverflow.com/questions/1392754

Thanks for solving this problem. It is indeed related to this registry key. Somehow, the 'Content Type' value changed from 'audio/wav' to 'audio'.

<!-- gh-comment-id:2826327363 --> @az-123-none commented on GitHub (Apr 24, 2025): > I don't know but maybe there is no `HKEY_CLASSES_ROOT.wav` in the Windows registry? > > https://stackoverflow.com/questions/1392754 Thanks for solving this problem. It is indeed related to this registry key. Somehow, the 'Content Type' value changed from 'audio/wav' to 'audio'.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/1Remote#1703
No description provided.