You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aspnetcore/blazor/components/class-libraries.md
+48-2Lines changed: 48 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -47,14 +47,37 @@ If the **Support pages and views** checkbox is selected to support pages and vie
47
47
@using Microsoft.AspNetCore.Components.Web
48
48
```
49
49
50
-
* Add the following `SupportedPlatform` item to the project file (`.csproj`):
50
+
* Add the following `SupportedPlatform` item and package reference for [`Microsoft.AspNetCore.Components.Web`](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.Web)to the project file (`.csproj`):
In the preceding example, the `{VERSION}` placeholder is the package version.
63
+
64
+
> [!IMPORTANT]
65
+
> When a Razor class library is added to a solution with the **Support pages and views** checkbox selected, the library also references the [`Microsoft.AspNetCore.App` ASP.NET Core shared framework](xref:fundamentals/metapackage-app):
> The shared framework isn't supported on Blazor WebAssembly, so libraries that target client-side apps should remove the framework reference. When the library targets both server-side and client-side apps, control the dependency with an [MSBuild condition](/visualstudio/msbuild/msbuild-conditions):
For more information on the `SupportedPlatform` item, see the [client-side browser compatibility analyzer](#client-side-browser-compatibility-analyzer) section.
59
82
60
83
:::moniker-end
@@ -93,14 +116,37 @@ If the `-s|--support-pages-and-views` option is used to support pages and views
93
116
@using Microsoft.AspNetCore.Components.Web
94
117
```
95
118
96
-
* Add the following `SupportedPlatform` item to the project file (`.csproj`):
119
+
* Add the following `SupportedPlatform` item and package reference for [`Microsoft.AspNetCore.Components.Web`](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.Web)to the project file (`.csproj`):
In the preceding example, the `{VERSION}` placeholder is the package version.
132
+
133
+
> [!IMPORTANT]
134
+
> When a Razor class library is added to a solution with the **Support pages and views** checkbox selected, the library also references the [`Microsoft.AspNetCore.App` ASP.NET Core shared framework](xref:fundamentals/metapackage-app):
> The shared framework isn't supported on Blazor WebAssembly, so libraries that target client-side apps should remove the framework reference. When the library targets both server-side and client-side apps, control the dependency with an [MSBuild condition](/visualstudio/msbuild/msbuild-conditions):
For more information on the `SupportedPlatform` item, see the [client-side browser compatibility analyzer](#client-side-browser-compatibility-analyzer) section.
0 commit comments