Oxygene in visual studio: Cannot create a WinForm


since the day before yesterday I have successfully ported a whole project group from .Net Framework 2 to .Net Framework 4.8 using the latest Oxygene release with Visual Studio Community 2022 Version 17.8.3.
But now I’m trying to create a new form for the first time:

This happens with Oxygene, not Visual C#. Can someone PLEASE tell me what I’m missing or don’t know…???

Thanks in advance,

Could you please provide an small test case to check?
I succefully created a Winforms app using VS community 2022 and build .2896 (latest one).
Checking the error message seems you don’t have installed .net 4.8?



I’ve made a little progress. The error message is misleading. It’s due to the referencing of a specific assembly. If I take out the reference, it works. But I can’t say WHY yet. Any ideas?
Life could be so beautiful :frowning:

Thank you for your efforts,

mscorlib should be referenced by default in any winforms project. Probably you added twice using another version, then removing the “wrong” one fixed it.

Do note that currently, Microsoft artificially limits the WInForms designer for .NET Core projects to only work with Visual C# and Visual Basic.NET, and actively prevents third-party languages auch as ours to use them. This is different from then (very same) designers on Classic .NET 4.8 and below projects, which all languages are allowed to use.

Are you sure that your project is actually using NET 4.8, and not .NET 5 or later (which would be Core)? That aside, my best guess would be that yes, either .NET 4.8 or Visual Studio itself ar not properly installed. Does this issue show for you with any new project you create, or just this specific one? Does the project build (and, thus, find mscorlib.dll) ok?


1 Like

Everything is working again! It was definitely due to referencing a wrapper assembly with very similar (not the same!) namespace identifiers as in the wrapped assembly. However, some of the identifiers only differ after up to 50 characters - but theoretically that shouldn’t play a role…
With VisualStudio 2013 and an older Oxygen version (8.x), this construct worked perfectly at both design and runtime. That’s why it took some time and energy to come up with this idea based on the error message posted :frowning:

Many thanks to you, especially for the information about the WinForm Designer and .Net Core - I didn’t know that.