Error message that says "Syncfusion does not contain a definition for Blazor"
I am attempting to build a line chart in a Blazor web app using Visual Studio. I have copied the example line chart from https://blazor.syncfusion.com/documentation/chart/chart-types/line, and created a page to test the ability to create a line chart. The test page is an exact copy of the example.
When I build the solution, the following line is highlighted
<ChartPrimaryXAxis ValueType="Syncfusion.Blazor.Charts.ValueType.Category"></ChartPrimaryXAxis>
and VS gives an error message stating: 'Syncfusion' does not contain a definition for 'Blazor'.
I have installed the Syncfusion.Charts NuGet package.
Note that I also have installed the Syncfusion.DataGrid package and the data tables in the solution are working properly.
The _Imports.razor includes:
@using Syncfusion.Blazor.Charts
@using Syncfusion.Blazor.Grids
App.razor contains the following:
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base rel='nofollow' href="/" />
<link rel="stylesheet" rel='nofollow' href="bootstrap/bootstrap.min.css" />
<link rel="stylesheet" rel='nofollow' href="app.css" />
<link rel="stylesheet" rel='nofollow' href="PorfolioAnalysis.styles.css" />
<link rel="icon" type="image/png" rel='nofollow' href="favicon.png" />
<!--Syncfusion-->
<link rel='nofollow' href=https://cdn.syncfusion.com/blazor/26.1.40/styles/bootstrap5.css rel="stylesheet" />
<script src="https://cdn.syncfusion.com/blazor/27.1.48/syncfusion-blazor.min.js" type="text/javascript"></script>
<script src="https://cdn.syncfusion.com/blazor/27.1.48/sf-textbox.min.js" type="text/javascript"></script>
<HeadOutlet />
</head>
Hi Dennis,
Thanks for using Syncfusion products.
We have validated your reported scenario with your attached script reference. The script reference varies based on installed NuGet packages.
Static Web Asset
|
Common NuGet(Syncfusion.Blazor) |
Individual NuGet |
|
<head> <link rel='nofollow' href="_content/Syncfusion.Blazor/styles/bootstrap5.css" rel="stylesheet" /> <script src="_content/Syncfusion.Blazor/scripts/syncfusion-blazor.min.js" type="text/javascript"></script> </head> |
<head> <link rel='nofollow' href="_content/Syncfusion.Blazor.Themes/bootstrap5.css" rel="stylesheet" /> <script src="_content/Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js" type="text/javascript"></script> </head> |
CDN
|
Common NuGet(Syncfusion.Blazor) |
|
<head> <script src=https://cdn.syncfusion.com/blazor/27.1.57/syncfusion-blazor.min.js type="text/javascript"></script> </head> |
For more information about script reference, please check with below documentation link.
UG : https://blazor.syncfusion.com/documentation/common/adding-script-references
We have prepared line chart sample. Please check with the below sample link. If you are still facing problem, please try to replicate the problem in below sample so that it will be helpful to validate this case further from our end.
Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/Chart1921613620.zip
Kindly revert us if you have any concerns.
Regards,
Durga Gopalakrishnan.
- 1 Reply
- 2 Participants
-
DI Dennis Imbro
- Nov 3, 2024 09:21 PM UTC
- Nov 4, 2024 02:21 PM UTC