I am developing a plugin for AutoCAD that connects to SharePoint On-Premises to retrieve lists, documents, and other resources. The plugin was originally developed for AutoCAD 2016 using .NET Framework 4.7. To facilitate the connection, I used the Microsoft.SharePoint2019.CSOM package.
The problem arises when migrating from AutoCAD 2016 to AutoCAD 2025. AutoCAD 2025 requires all projects and plugins to be migrated to .NET 8.0. However, SharePoint On-Premises does not support .NET versions higher than 4.7 or 4.8, as mentioned in this Stack Overflow link.
Here’s a snippet of the code I am using:
using (ClientContext context = new ClientContext(sharepointUri))
{
context.Credentials = new NetworkCredential("firstname.lastname", "password");
Web web = context.Web;
context.Load(web);
context.ExecuteQuery();
}
I confirmed that this code works perfectly in a console application targeting .NET Framework 4.7. However, when I run this within the AutoCAD 2025 environment targeting .NET 8.0, I encounter a 401 Unauthorized error.
The SharePoint environment is On-Premises, and all systems are within the same network.
Authentication details and configurations (e.g., NTLM, Kerberos) have been checked and work fine in the .NET Framework 4.7 context.
Is there a way to make SharePoint On-Premises authentication work with .NET 8.0, or is it strictly limited to .NET Framework 4.7/4.8?
What are some possible workarounds or solutions to enable the plugin to function in AutoCAD 2025 while still accessing SharePoint On-Premises?
Are there any best practices or configurations I might be missing to handle authentication correctly in this new environment?