Using .NET Framework 4.0 in Add-in Applications
SOLIDWORKS
Enterprise PDM versions... |
Support
.NET Framework... |
2013 and
later |
4.0, 3.5, 3.0, and 2.0 |
2009 and
later |
3.5, 3.0, and 2.0 |
2008 and
earlier |
2.0 |
If your SOLIDWORKS Enterprise PDM 2012 or earlier version add-in application
is compiled using Microsoft Visual Studio 2010 and .NET Framework 4.0, then
SOLIDWORKS Enterprise PDM displays the following message when you load the
add-in:
“The Archive Server could not open the Windows Registry.”
- Right-click the project in the Solution Explorer.
- Select Properties.
- Click Compile > Advanced Compile Options.
- Select .NET Framework 2.0 or earlier.
- Click OK.
After changing your project’s target framework to .NET Framework 2.0, you might not be able to reference the SOLIDWORKS Enterprise PDM
nnnn
Type Library (EdmInterface.dll), because Visual Studio creates primary interop assemblies using the latest version of .NET Framework (4.0), and your
project targets an earlier version of .NET Framework. If you encounter this
problem, you can generate a compatible SOLIDWORKS Enterprise PDM primary interop
assembly by using the Microsoft's Type Library Importer (TlbImp.exe) that is
included in an earlier
version of the Microsoft .NET Framework SDK.
- Download and install a version of .NET Framework SDK that is
compatible with your add-in project's version.
- Open a Windows Command Prompt.
- Navigate to C:\Program Files\Microsoft SDKs\Windows\vx.x\Bin
in which the earlier .NET Framework version of TlbImp.exe is
installed.
- Type TlbImp.exe install_dir\EdmInterface.dll /sysarray /out:Interop.EdmLib.dll /namespace:EdmLib.
NOTE: Typically install_dir is C:\Program
Files\SolidWorks Enterprise PDM.
- C++
This problem can occur at runtime if the add-in failed to register its DLL
during the build process. To solve this problem, ensure that your add-in
registers the DLL:
- Open your C++ add-in project.
- Right-click the project in the Solution Explorer.
- Select Properties.
- Click Linker > Input.
- Configure Module Definition File to point to the add-in's
project_name.def.
- Save the project.
- Click Build > Clean Solution.
- Click Build > Build Solution.
See Also
Using .NET Framework in
Stand-alone Applications