dotnet / dotnet/aspnetcore

Razor runtime compilation fails for duplicate types using extern aliases.

Open
#41,632 8 comments 0 reactions 0 assignees View on GitHub
area-mvc feature-runtime-compilation
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Describe the bug

Runtime compilation ignore the project references, assembly references or package references aliases.
I get a type exists in both assemblies error.

### Expected Behavior

Aliases should be supported.

### Steps To Reproduce

Create two class library projects with the same type name and namespace. Import one and the other in an asp.core project. Use an alias for one of them. Use the type without alias in a razor view and enable runtime compilation.

### Exceptions (if any)

Type exists in both assemblies exception.

### .NET Version

dotnet --6.0

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.