.NET core
Folder Structure
For a CADViewer dotNetcore installation on Windows, the base file-structure should be as below:
CADViewer and AutoXchange is included in this repository, but it can be recreated by downloading the components directly from: https://cadviewer.com/download, or from our dotNetCore GitHub Repository.
c:\cadviewer-testapp-dotnet-core-01\cadviewer\cadviewer\ └─── wwwroot ├── app │ ├── cv │ │ ├── cv-pro │ │ │ ├── menu_config │ │ │ ├── language_table │ │ │ └── space │ │ │ ├── css │ │ │ └── html │ │ ├── cv-core │ │ │ ├── menu_config │ │ │ └── language_table │ │ └── cv-custom_commands │ ├── fonts │ ├── images │ ├── js │ ├── css │ └── user_resources ├── converters │ ├── ax2022 │ │ ├── windows │ │ │ └── fonts │ │ └── linux │ │ └── fonts │ ├── dwgmerge2022 │ │ ├── windows │ │ │ └── fonts │ │ └── linux │ │ └── fonts │ ├── linklist2022 │ │ ├── windows │ │ │ └── fonts │ │ └── linux │ │ └── fonts │ └── files ├── content ├── html └── temp_print
Note that folders for controller configuration are set as part of the dotNet core main project
Windows - dotNETcore Configuration - set paths
In folder:
c:\cadviewer-testapp-dotnet-core-01\cadviewer └─── cadviewer └── appsettings.json
locate the configuration file: appsettings.json , edit the key settings that controls Converter and CADViewer paths to reflect your installation.
Windows - dotNETcore Controller
In folder:
c:\cadviewer-testapp-dotnet-core-01\cadviewer └─── cadviewer └─── Controllers └── CADViewerController.cs
The file CADViewerController.cs contains the controllers that CADViewer uses to manipulate content on the server and to control CAD conversion.
HTML
In folder:
c:\cadviewer-testapp-dotnet-core-01\cadviewer └─── cadviewer └── html
identify your sample mysample.html file, and ensure that it correctly sets the ServerLocation and ServeUrl parameters.
For the combination of JavaScript front-end and dotNetCore back-end a typical Handler initialization in any of the sample .html files looks like:
var ServerBackEndUrl = "https://localhost:44374/";
var ServerLocation = "";
var ServerUrl = "https://localhost:44374/";
// Pass over the location of the installation: will update the internal paths, as well as front-end and back-end platforms
// last parameter is the controller name , ServerBackEndUrl+controller = controller path
cvjs_setAllServerPaths_and_Handlers(ServerBackEndUrl, ServerUrl, ServerLocation, "dotNetCore", "JavaScript", "floorPlan", "CADViewer");```
The method cvjs_setAllServerPaths_and_Handlers() sets the front-end and back-end combination as well as the controlling paths.
Note that the last parameter in this method is the controller name. If the controller name variable is undefined or “”, then the back-end location must be the url of the end-point itself, so: ServerBackEndUrl = “https://localhost:44374/CADViewer” if running the CADViewer dotNetCore samples.
See API documentation:
- cvjs_setAllServerPaths_and_Handlers() - required
Finally open a web-browser pointing to your sample html file: http:/localhost:44374/html/mysample.html (where “mysample” is any of the files in the /html/ folder)
Debugging
Use the server traces and browser development console for debugging, alternatively contact our Support
For debugging, the folder:
c:\cadviewer-testapp-dotnet-core-01\cadviewer └─── cadviewer └─── wwwroot └── temp_debug
contains several debug files, for conversion it is callApiConversionHandlerLog.txt which lists the command line and traces in the communication with the back-end converter AutoXchange 2023. If drawing files does not display, this file will contain useful information to pinpoint the issue.
Please also see our FAQ for dotNetCore - conversions/pdf not working.
Troubleshooting
One issue that often appears in installations is that interface icons do not display properly:
Typically the variables ServerUrl and ServerBackEndUrl are not set to reflect the front-end and back-end server url or port.