Normalize the content root and improve errors (#36990)
* Normalize the content root and improve errors - When trying to compare content root paths, make sure the paths are normalized before doing so. Today we throw too aggresively when libraries try to set the content root, even if that would have resulted in a noop. This change normalizes the initial path and the attempted path before doing the comparison. - We also improve the error message when the user tries to change the host settings, directing them to the correct API to use instead. * PR feedbacj * Make it static * Resolve the full path to handle . and .. * Linux paths
显示
- src/DefaultBuilder/src/BootstrapHostBuilder.cs 4 个添加, 14 个删除src/DefaultBuilder/src/BootstrapHostBuilder.cs
- src/DefaultBuilder/src/ConfigureHostBuilder.cs 6 个添加, 5 个删除src/DefaultBuilder/src/ConfigureHostBuilder.cs
- src/DefaultBuilder/src/ConfigureWebHostBuilder.cs 28 个添加, 17 个删除src/DefaultBuilder/src/ConfigureWebHostBuilder.cs
- src/DefaultBuilder/src/ContentRootResolver.cs 27 个添加, 0 个删除src/DefaultBuilder/src/ContentRootResolver.cs
- src/DefaultBuilder/test/Microsoft.AspNetCore.Tests/WebApplicationTests.cs 48 个添加, 0 个删除...er/test/Microsoft.AspNetCore.Tests/WebApplicationTests.cs
想要评论请 注册 或 登录