Go Back

Error using Windowing API with ".NET 8.0 Windows"

Article Number: 2527
First Published:
Modified:
Recent Activity:
Views: 111
OS: Windows
Product: Synergy .NET

Testing with a .NET 8.0 release candidate has shown that an error can occur in certain circumstances. If an app uses the synrnt 12.2.1.1008 or earlier NuGet package and targets ".NET 8.0 Windows," it may crash if it attempts to access UI Toolkit or the low-level Synergy windowing API (the W_ routines). For example,


Unhandled exception. System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exception.

at Synergex.SynergyDE.SynRTL.dw_updt(Void* wnd, DESCRIP** descr)

at Synergex.SynergyDE.SysRoutines.s_w_updt()

at _NS_wndtestcorewin._CL.MAIN$WNDTEST(String[] args) in ...


Apps targeting ".NET 8.0" instead of ".NET 8.0 Windows" shouldn\'t be affected, nor should apps that target earlier versions of .NET or that don\'t use either UI Toolkit or the windowing API.


The error appears to be caused by a mismatch in framework versions between synwnd.runtimeconfig.json and *appname*.runtimeconfig.json. We expect to resolve this in an upcoming release. In the meantime, you can work around the error by modifying the copy of synwnd.runtimeconfig.json so that the .NET versions match those in the runtimeconfig.json file for your app. For example,


{

"runtimeOptions": {

"tfm": "net8.0",

"frameworks": [

{

"name": "Microsoft.NETCore.App",

"version": "8.0.0-rc.2.23479.6"

},

{

"name": "Microsoft.WindowsDesktop.App",

"version": "8.0.0-rc.2.23479.10"

}

],

"configProperties": {

"System.Reflection.Metadata.MetadataUpdater.IsSupported": false

}

}

}


Note that the "version" values should exactly match the values in the runtimeconfig.json file for your app, which may be different than the ones in this example. Also note that the "frameworks" array should keep that name, even if the app\'s runtimeconfig.json file says "includedFrameworks."


Other potential workarounds are to remove your app\'s runtimeconfig.json file or to edit it so its values match those in synwnd.runtimeconfig.json.



THE INFORMATION PROVIDED TO YOU IN THIS SERVICE IS FOR YOUR USE ONLY. THE INFORMATION MAY HAVE BEEN DEVELOPED INTERNALLY BY SYNERGEX OR BY EXTERNAL SOURCES. SYNERGEX MAKES NO WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS INFORMATION, INCLUDING THE WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SYNERGEX BE LIABLE FOR ANY DAMAGES OR LOSSES INCURRED BY YOU IN USING OR RELYING ON THIS INFORMATION, INCLUDING WITHOUT LIMITATION GENERAL DAMAGES, DIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES, OR LOSS OF PROFITS, EVEN IF SYNERGEX HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Please log in to comment on this article.