dotnet-core/release-notes/3.0/preview/3.0.0-preview-known-issues.md

85 lines
3.8 KiB
Markdown
Raw Normal View History

# .NET Core 3.0 Preview Known Issues
This document lists known issues for **.NET Core 3.0 Preview releases** which may be encountered during usage.
## ASP.NET Core
### Preview 3
- **Updates to .razor files fail to show up in subsequent builds**: Updates to Razor Component (.razor) in Visual Studio may fail to show up in subsequent builds. To work around this issue add the following item group to the project file:
```xml
<ItemGroup>
<UpToDateCheckInput Include="@(Content->WithMetadataValue('Extension', '.razor'))" />
</ItemGroup>
```
- **Updates to Razor Components in .razor files fail to show up in IntelliSense**: Updates to Razor Components defined in .razor files may fail to show up in IntelliSense in Visual Studio. To workaround this issue rebuild the project.
- **Single Page Applications with authentication enabled throws method not found exception when visiting the register or login pages**: The exception message is the one below.
`Method not found: 'Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder``1.HasIndex(System.Linq.Expressions.Expression``1<System.Func``2<!0,System.Object>>)'.` To workaround this issue follow these steps:
* Replace the following package references with the ones below in your csproj folder:
```xml
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.0.0-preview3-19153-02" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.0.0-preview3.19153.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0-preview3.19153.1" />
```
```xml
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.0.0-preview-18579-0056" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.0.0-preview.19080.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0-preview.19080.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.0.0-preview.19080.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.0.0-preview.19080.1" />
```
* Add the following snippet to your csproj file:
```xml
<PropertyGroup>
<NoWarn>$(NoWarn);NU1605</NoWarn>
</PropertyGroup>
```
- **Referencing 3.0.0 MVC libraries don't work as intended**: There are several issues with referencing a 3.0.0 MVC library.
* Razor pages will 404,
* ApplicationParts and factories will not be discoverable
* Controllers will not be discoverable
To workaround this issue do the following:
* Add the helper method:
```C#
private void Add30AssemblyWorkaround(Assembly referencedAssembly, ApplicationPartManager applicationPartManager)
{
var partFactory = ApplicationPartFactory.GetApplicationPartFactory(referencedAssembly);
foreach (var part in partFactory.GetApplicationParts(referencedAssembly))
{
applicationPartManager.ApplicationParts.Add(part);
}
var relatedAssemblies = RelatedAssemblyAttribute.GetRelatedAssemblies(referencedAssembly, throwOnError: true);
foreach (var assembly in relatedAssemblies)
{
partFactory = ApplicationPartFactory.GetApplicationPartFactory(assembly);
foreach (var part in partFactory.GetApplicationParts(assembly))
{
applicationPartManager.ApplicationParts.Add(part);
}
}
}
```
* Modify your `services.AddMvc()` call in `Startup.cs`:
```
services.AddMvc()
.ConfigureApplicationPartManager(manager =>
{
var referencedAssembly = Assembly.Load("RCL");
Add30AssemblyWorkaround(referencedAssembly, manager);
})
...
```