.NET 8 API in V26
We have a quite complex application based on .NET running successfully until version V25. With the change to .NET 8 in V26 we have huge problems:
The front-end application was easily converted to .NET 8 as described in the online help. The core functions which do not require any backend are working without any problem.
Unfortunately, we have many database functions which handle the exchange between a BricsCad drawing and our ERP solution. There are tons of background classes in libraries which cannot be changed to .NET 8.0 immediatly. When we link one of these .NET 4.7.2 framework DLLs to the project, the APP cannot be loaded in Bricscad V26 anymore. This kills 60% of our functionality and makes our development useless at the moment. Is there any experiance or workaround known?
As a side note: We offer also web-solutions, developed in .NET 8 ASP .NET Core. There it is absolutely not a problem to use .NET 8 front-ends in combination with DLLs from the .NET framework.
Any information is much appreciated.
Comments
-
Are you testing with the latest maintenance release? In any case, please submit a support request so our expert support analysts can assist.
0 -
In my experience, any old DLL can be loaded and executed in V26 without recompilation if it doesn't use modules that MS forgot to include in the Net8 core. If your DLL uses these modules, it will need to be reprogrammed and recompiled for Net8. Furthermore, you'll have to manually load all the libraries that were previously in .Net but are now separate DLLs. Consequently, you'll have to rewrite the installer to deliver these DLLs to users. (Sorry for the unprofessional terminology.)
0 -
Moreover, you should check whether BricsCAD V26 is loading the DLLs you need automatically. For example, it turned out that I don't need to force two of the three DLLs I need into AutoCAD 2025.
Here's an initialization module, for example, which I compile for Net4.8 and load into any(!) version of BricsCAD. It works perfectly in V26. Then, in this module, I select which main assembly to run for this version of Brics. I also load the MS support DLLs (former .Net parts). Only then do I load the main plugin module, compiled for Net8.
public void Initialize()
{
try
{
string v = (string)CadApp.GetSystemVariable("_VERNUM");
int ver = 0;
if (!IsNullOrEmpty(v) && int.TryParse(v.Substring(0, 2), out int i)) ver = i;
string dll = ver >= 26 ? "AVC_Plugin_Br26.dll" :
ver >= 21 ? "AVC_Plugin_Br21.dll" :
"AVC_Plugin_Br.dll";…
if (ver >= 26)
{
Assembly.LoadFrom(Path.Combine(path, "System.Data.SqlClient.dll");
Assembly.LoadFrom(Path.Combine(path, "System.CodeDom.dll");
Assembly.LoadFrom(Path.Combine(path, "System.Management.dll");
}
Assembly.LoadFrom(newDll, true));
}
catch (System.Exception ex) { Warning(ex.Message); }
}0 -
@avc_programming : Thank you very much! I am going to try that and leave a post here with the result.
0
