Troubleshooting
If you encounter errors while installing the Sage CRM .NET SDK or if the C# templates are not available in Microsoft Visual Studio or return errors (such as "This template attempted to load an untrusted component"), follow the instructions in the topics below.
Install .NET DLLs manually
To work with the Sage CRM .NET SDK, the following DLL assemblies must be installed to the GAC (Global Assembly Cache) folder and properly registered:
SageCrmEntityWizard.dll. Installed and registered by the .NET SDK Setup.
SageCRMNet.dll and SageCrmWrapper.dll. Installed and registered by the main Sage CRM Setup.
In .NET Framework 2.0, the default location of the Global Assembly Cache is %windir%\assembly.
In some situations, the automatic installation and registration of the above assemblies may fail. If so, you may receive an error message when you install the .NET SDK or create a new C# project from a template supplied with the .NET SDK. The error may be similar to the following:
"This template attempted to load an untrusted component."
To fix this issue, manually install and register the assemblies:
On the computer where the Sage CRM .NET SDK is installed, open the Visual Studio Command Prompt.
Change directory to the folder where the above-listed DLL assemblies are stored. By default, this is %ProgramFiles(x86)%\Sage\CRM\CrmDotNet\{Sage CRM version number}.
Example:
cd %ProgramFiles(x86)%\Sage\CRM\CrmDotNet\2022
Use the
gacutil /if
command to force the installation of each DLL:gacutil /if sagecrmnet.dll
Use the
regasm
command to register each installed DLL:regasm sagecrmnet.dll
Copy templates, projects, and snippets manually
In some situations, the Sage CRM C# project templates, code snippets, and examples supplied with the Sage CRM .NET SDK may be missing from Microsoft Visual Studio when you create a new C# project. This happens when the template files Sage CRM Basic Template.zip and Sage CRM Entity Template.zip are copied to the incorrect folder on your computer.
To fix this issue, copy Sage CRM Basic Template.zip and Sage CRM Entity Template.zip to the correct folder:
%userprofile%\Documents\{Visual Studio version}\Templates\ProjectTemplates\Visual C#
To make the C# project templates, code snippets, and examples available in Visual Studio, you may need to manually copy them to the following locations in your user profile folder (%userprofile%):
C# templates:
%userprofile%\Documents\{Visual Studio version}\Templates\ProjectTemplates\Visual C#
Visual Studio example projects:
%userprofile%\Documents\{Visual Studio version}\Projects
Client-side and COM JavaScript snippets:
%userprofile%\Documents\{Visual Studio version}\Code Snippets\JavaScript\My Code Snippets
HTML snippets for setting up ASP pages:
%userprofile%\Documents\{Visual Studio version}\Code Snippets\Visual Web Developer\My HTML Snippets