ColdFusion returns “Class not found” when trying to consume a *modern* public static .Net class. What is the latest version that I can use?
I’ve spent most of the day hacking away at trying to get ColdFusion to return data from a simple class that I created in .Net 6. I get the same error when I try to call the component with CFML or cfScript:
Class CoderPro.Blog.Networking.Connectivity not found in the specified assembly list.
cfHTML
<cfobject type="dotnet" name="pingClass" assembly="D:/Projects/Clients/CoderPro.Blog/CoderPro.Blog.Networking/bin/Debug/net6.0/CoderPro.Blog.Networking.dll"
class="Connectivity" />
cfScript
var testInstance = CreateObject(".NET", "CoderPro.Blog.Networking.Connectivity", "D:/Projects/Clients/CoderPro.Blog/CoderPro.Blog.Networking/bin/Debug/net5.0-windows/CoderPro.Blog.Networking.dll");
I checked System.Environment.GetVersion & it returns 4.0.30319.42000. I’ve researched online, but I haven’t found a clear answer to what is the latest version of .Net that I can use with ColdFusion. Before someone says that I can use a web service, I know that. This is a PoC requiring CF to consume a .Net class. I can’t believe that it is 2022 & I can’t use .Net 6/5 or even one of the versions of Core?! Am I really limited to legacy .Net Standard?
I almost forgot to mention that I’m using ColdFusion 2021