Skip to content

Commit 802f936

Browse files
authored
VS Code convert wizard and docs improvements (#323)
1 parent b89dc01 commit 802f936

17 files changed

+203
-50
lines changed

_contentTemplates/common/general-info.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ You can get them from the:
5757
#end
5858

5959

60+
#vs-code-x-download
61+
You can get the extension:
62+
63+
* from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=TelerikInc.blazortemplatewizard)
64+
65+
* by opening the **Extensions** tab in Visual Studio Code, then searching for **Telerik UI for Blazor Template Wizard** and clicking **Install**
66+
#end
67+
6068

6169
#valuebind-vs-databind-link
6270
For details on Value Binding and Data Binding, and the differences between them, see the [Value Binding vs Data Binding]({%slug get-started-value-vs-data-binding%}) article.
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
title: Convert to Telerik Project
3+
page_title: Convert to Telerik Project - Visual Studio Code Integration
4+
description: Learn how to convert your existing Blazor app to use Telerik components in it with a few clicks through our Visual Studio Code Templates.
5+
slug: getting-started-vs-code-integration-convert-project
6+
position: 3
7+
---
8+
9+
# Convert to Telerik Application
10+
11+
This article demonstrates how to enable the Progress® Telerik® UI for Blazor components in your existing Blazor app with a single VS Code command.
12+
13+
To add the Telerik Components to your existing Blazor application, use the `Convert Command` of the Telerik UI for Blazor Visual Studio Code Extension.
14+
15+
>caption In this article:
16+
* [Get the Extension](#get-the-extension)
17+
18+
* [Convert your project](#convert-your-project)
19+
20+
* [Troubleshooting](#troubleshooting)
21+
22+
23+
## Get the Extension
24+
25+
@[template](/_contentTemplates/common/general-info.md#vs-code-x-download)
26+
27+
28+
## Convert your project
29+
30+
1. Press `Ctrl`+`Shift`+`P` in Windows/Linux or `Cmd`+`Shift`+`P` on Mac to open VSCode's extension launcher
31+
32+
![Launch Convert Command](images/launch-convert-command.png)
33+
34+
1. Type/Select `Telerik UI for Blazor Convert Command: Launch` and press `Enter` to launch the convert command
35+
36+
1. The conversion process will start
37+
38+
39+
1. The following notification will appear in the bottom right corner of the VS Code to indicate that the conversion has successfully passed.
40+
41+
![Success Notification](images/successfully-converted-example.png)
42+
43+
44+
If the Telerik components are already enabled in the project you will see the following notification:
45+
46+
![Already converted project Notification](images/already-converted-example.png)
47+
48+
49+
>tip You now have enabled the Progress® Telerik® UI for Blazor components in your Blazor app!
50+
51+
52+
## Troubleshooting
53+
54+
There are a few common problems that might occur when converting a project:
55+
56+
57+
* [_Imports.razor not found](#_importsrazor-not-found)
58+
* [MainLayout.razor not found](#mainlayoutrazor-not-found)
59+
* [_Host.cshtml or index.html is malformed, don't exist or does not contain a head element](#_hostcshtml-or-indexhtml-is-malformed-dont-exist-or-does-not-contain-a-head-element)
60+
* [Unable to locate services collection](#unable-to-locate-services-collection)
61+
* [No suitable project to convert](#no-suitable-project-to-convert)
62+
63+
### _Imports.razor not found
64+
65+
The Telerik extension searches for the default `_Imports.razor` file in order to add the `Telerik.Blazor` and `Telerik.Blazor.Components` namespaces. If you don't have a `_Imports.razor` file in your project or if you have renamed it, you will get the following error when trying to convert the project:
66+
67+
![_Imports.razor not found](images/imports-not-found-example.png)
68+
69+
In order to fix this, double check to make sure you have the `_Imports.razor` file with its default naming.
70+
71+
### MainLayout.razor not found
72+
73+
The Telerik extension searches for the default `MainLayout.razor` file in order to add the `TelerikLayout`. If you don't have a `MainLayout.razor` file in your project or if you have renamed it, you will get the following error when trying to convert the project:
74+
75+
![MainLayout.razor not found](images/mainlayout-not-found-example.png)
76+
77+
In order to fix this, double check to make sure you have the `MainLayout.razor` file with its default naming.
78+
79+
### _Host.cshtml or index.html is malformed, don't exist or does not contain a head element
80+
81+
The Telerik extension searches for the default `_Host.cshtml` file in a Blazor Server-side app and `index.html` file in a Blazor WASM app in order to add the Telerik UI for Blazor CSS and JavaScript files in its `<head>` tag. In case you have renamed the `_Host.cshtml`/`index.html` file, you have deleted it or removed its `<head>` tag you will get the following error when trying to convert the project:
82+
83+
![Changed _Host.cshtml file](images/changed-host-example.png)
84+
85+
In order to fix this, double check to make sure you have the `_Host.cshtml`/`index.html` file with its default naming and it contains a `<head>` tag.
86+
87+
88+
### Unable to locate services collection
89+
90+
The Telerik extension searches for the default `Startup.cs` and `Program.cs` files to make the necessary for the conversion changes. In case you have renamed them, the extension will not be able to find them and you will get the following error:
91+
92+
![Unable to locate services collection](images/unable-to-locate-services-example.png)
93+
94+
In order to fix this, double check to make sure you have the `Startup.cs` and `Program.cs` files with their default naming.
95+
96+
97+
### No suitable project to convert
98+
99+
If you are trying to invoke the `Telerik UI for Blazor Convert Command` on a project other than Blazor, you will get the following error:
100+
101+
![No suitable project to convert](images/no-suitable-project-to-convert-example.png)
102+
103+
The `Telerik UI for Blazor Convert Command` is only applicable on Blazor Server or WASM applications and in order to achieve successful conversion, double check to make sure you are applying the command on a Blazor project.
24.3 KB
Loading
27.8 KB
Loading
15.8 KB
Loading
8.54 KB
Loading
7.4 KB
Loading
16 KB
Loading
10.5 KB
Loading
14.5 KB
Loading

0 commit comments

Comments
 (0)