In case Visual Studio decides not to show the new templates try this:
For Visual Studio 2017 and 2019, open the VS command line and run:
For Visual Studio 2022, open the VS command line and run:
If it still doesn't work, check if the \Wisej.NET 2 or \Wisej.NET 3 templates are present on your development machine under your user name here:
Documents\Visual Studio (2019|2022)\Templates\ProjectTemplates\Visual C#
Documents\Visual Studio (2019|2022)\Templates\ProjectTemplates\Visual Basic
Starting with Wisej.NET 3.0, we took the approach of distributing the Designer and the templates in a Visual Studio Extension format.
The path to the templates can vary from one machine to another:
%LOCALAPPDATA%\Microsoft\VisualStudio\17.0_{id}\Extensions\{extension_id}
As an example, it can be something like this:
%LOCALAPPDATA%\Microsoft\VisualStudio\17.0_315d49d1\Extensions\x2rkvlci.xbt
In case the project templates (or item templates) for Wisej.NET are missing, either run the installer again and select Repair, or download the templates below.
If multiple developers use the same machine, installing a VSIX package can become a challenge. To manage this efficiently, you might need to manually install the VSIX package using the Visual Studio Developer Command Prompt. This method ensures that the extension is accessible to all users on the system. You can achieve this by executing the command VSIXInstaller /admin path_to_the_vsix.vsix
. This command runs the installer with administrative privileges, making sure the extension is deployed globally rather than limited to a single user profile.
We also provide the templates to download as another option:
Unblock the zip (this is important!) and expand into:
Documents\Visual Studio (2019|2022)\Templates
Select to overwrite existing files when asked. The zip archives contain the \ItemTemplates and \ProjectTemplates files in the same structure expected by Visual Studio.
Templates will not show up when starting a Visual Studio Experimental Instance.
Occasionally you may start getting designer errors when opening a container in design mode. The most common error is "Unable to cast type..." It's a well-known issue related to Visual Studio having to load a shadow copy of the assemblies used at design time.
Since assemblies cannot be unloaded in .NET Framework, Visual Studio loads shadow copies of the assemblies loaded by the designer. Sometimes it ends up loading the same assembly multiple times, leading to the "Unable to cast" error because the same type is loaded more than once.
The WebView2 component can be silently updated by Microsoft, these updates can eventually break Wisej.NET's Edge-based renderer.
In case you encountered this issue, please post in our forum, or contact us via email.
The current workaround for this type of issue is to switch back to the Internet Explorer renderer, this allows you to use the designer with little to no issues, one side effect would be the use of some complex JavaScript components that don't usually work with IE.
We're constantly updating the Designer component, please make sure to follow the forum for any pinned post, usually, those posts would contain links to newer releases of the Wisej.NET Designer.
If an opened designer looks empty, that usually means that the WebView2 component is what causing the issue, make sure to click on the "Edge" icon found in the lower left of the Designer window, and report the version number to us.
Usually, it's enough to:
Close all designer tabs
Close all Visual Studio instances
Delete /bin, /obj, /.vs
Open Visual Studio and reload the solution
Recompile
Visual Studio makes shadow copies of the assemblies loaded by the designer here:
%LOCALAPPDATA%\Microsoft\VisualStudio{version}\Designer\ShadowCache
Each installation of Visual Studio has a different unique ID. Visual Studio 2019 versions start with "16.0" and Visual Studio 2022 versions start with "17.0".
Run the >devenv command above again.
If it still doesn't work, delete the Visual Studio templates cache. Each installation of Visual Studio has a different unique ID. Visual Studio 2019 versions start with "16.0" and Visual Studio 2022 versions start with "17.0".
Run the >devenv command above again.
If you still get the problem, try to clean the designer assembly cache and repeat the steps above.
Reopen Visual Studio, recompile again and the problem should be solved.