C
C#11mo ago
...

System.Speech incompatible with PublishSIngleFile / PublishTrimmed

When I compile my project that uses speech syntheis to read something, even though I have
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<PublishSingleFile>true</PublishSingleFile>
<PublishTrimmed>true</PublishTrimmed>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<PublishSingleFile>true</PublishSingleFile>
<PublishTrimmed>true</PublishTrimmed>
in my csproj file there is still a separate DLL that gets created that my exe will not work without and an error that says
Unhandled exception. System.NotSupportedException: Built-in COM has been disabled via a feature switch. See https://aka.ms/dotnet-illink/com for more information.
at System.Speech.Internal.ObjectTokens.RegistryDataKey..ctor(String fullPath, SafeRegistryHandle regHandle)
at System.Speech.Internal.ObjectTokens.RegistryDataKey.Open(String registryPath, Boolean fCreateIfNotExist)
at System.Speech.Internal.ObjectTokens.ObjectTokenCategory.Create(String sCategoryId)
at System.Speech.Internal.ObjectTokens.SAPICategories.DefaultDeviceOut()
at System.Speech.Internal.Synthesis.VoiceSynthesis..ctor(WeakReference speechSynthesizer)
at System.Speech.Synthesis.SpeechSynthesizer.get_VoiceSynthesizer()
at System.Speech.Synthesis.SpeechSynthesizer.SelectVoice(String name)
at SystemSpeech.Program.Main(String[] args) in C:\Users\anton\Documents\cshart\SystemSpeech\Program.cs:line 19
Unhandled exception. System.NotSupportedException: Built-in COM has been disabled via a feature switch. See https://aka.ms/dotnet-illink/com for more information.
at System.Speech.Internal.ObjectTokens.RegistryDataKey..ctor(String fullPath, SafeRegistryHandle regHandle)
at System.Speech.Internal.ObjectTokens.RegistryDataKey.Open(String registryPath, Boolean fCreateIfNotExist)
at System.Speech.Internal.ObjectTokens.ObjectTokenCategory.Create(String sCategoryId)
at System.Speech.Internal.ObjectTokens.SAPICategories.DefaultDeviceOut()
at System.Speech.Internal.Synthesis.VoiceSynthesis..ctor(WeakReference speechSynthesizer)
at System.Speech.Synthesis.SpeechSynthesizer.get_VoiceSynthesizer()
at System.Speech.Synthesis.SpeechSynthesizer.SelectVoice(String name)
at SystemSpeech.Program.Main(String[] args) in C:\Users\anton\Documents\cshart\SystemSpeech\Program.cs:line 19
(but only when using PublishTrimmed, without that there is just an unwanted DLL that is required for running the exe) I am far too inexperienced to know what any of this means and would just like a self contained EXE with all the code required to run standalone produced on compilation
1 Reply
...
...11mo ago
bruh
Want results from more Discord servers?
Add your server