From ec6eaad7667e6374af5b6c5639d2f4780b431215 Mon Sep 17 00:00:00 2001 From: Marc Paine Date: Thu, 5 Sep 2024 12:57:52 -0700 Subject: [PATCH 1/4] Add known issue for RC1 incompatibility with 17.11 --- release-notes/9.0/known-issues.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/release-notes/9.0/known-issues.md b/release-notes/9.0/known-issues.md index 18457fdb60..ee34576148 100644 --- a/release-notes/9.0/known-issues.md +++ b/release-notes/9.0/known-issues.md @@ -39,3 +39,18 @@ private void ReactiveWindow_ContentRendered(object sender, System.EventArgs e) ``` The behavior will be **fixed in .NET 9 RC1** release. + +## .NET SDK + +#### .NET 9.0.100-RC.1 will fail when used with 17.11 + +There is an incompatible dependency between a file loaded from the SDK and the dependencies that Visual Studio includes. + +``` +NETSDK1060 Error reading assets file: Error loading lock file '...\obj\project.assets.json' : Could not load file or assembly 'System.Text.Json, Version=8.0.0.4, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. +``` +**Workaround** +If you must use 17.11, you may be able to workaround this by copying a file from the SDK into a Visual Studio folder (note that you should delete this file in the future) +`copy "C:\Program Files\dotnet\sdk\9.0.100-preview.7.24407.12\Sdks\Microsoft.NET.Sdk\tools\net472\System.Text.Json.dll" "C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\CommonExtensions\Microsoft\NuGet"` + +This behavior will be **fixed in .NET 9 SDK RC2** release From 047dce8cc7116046ec4d1f3830489a0f74f40a46 Mon Sep 17 00:00:00 2001 From: Marc Paine Date: Fri, 6 Sep 2024 11:41:21 -0700 Subject: [PATCH 2/4] Removed the workaround as we haven't gotten it working. --- release-notes/9.0/known-issues.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/release-notes/9.0/known-issues.md b/release-notes/9.0/known-issues.md index ee34576148..902e37bb4c 100644 --- a/release-notes/9.0/known-issues.md +++ b/release-notes/9.0/known-issues.md @@ -49,8 +49,4 @@ There is an incompatible dependency between a file loaded from the SDK and the d ``` NETSDK1060 Error reading assets file: Error loading lock file '...\obj\project.assets.json' : Could not load file or assembly 'System.Text.Json, Version=8.0.0.4, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. ``` -**Workaround** -If you must use 17.11, you may be able to workaround this by copying a file from the SDK into a Visual Studio folder (note that you should delete this file in the future) -`copy "C:\Program Files\dotnet\sdk\9.0.100-preview.7.24407.12\Sdks\Microsoft.NET.Sdk\tools\net472\System.Text.Json.dll" "C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\CommonExtensions\Microsoft\NuGet"` - This behavior will be **fixed in .NET 9 SDK RC2** release From 346b6ada98d731fc87bad505718677b8c9bfe622 Mon Sep 17 00:00:00 2001 From: Marc Paine Date: Mon, 9 Sep 2024 13:07:52 -0700 Subject: [PATCH 3/4] clarify fixed in details --- release-notes/9.0/known-issues.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-notes/9.0/known-issues.md b/release-notes/9.0/known-issues.md index 902e37bb4c..1b595fff24 100644 --- a/release-notes/9.0/known-issues.md +++ b/release-notes/9.0/known-issues.md @@ -49,4 +49,4 @@ There is an incompatible dependency between a file loaded from the SDK and the d ``` NETSDK1060 Error reading assets file: Error loading lock file '...\obj\project.assets.json' : Could not load file or assembly 'System.Text.Json, Version=8.0.0.4, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. ``` -This behavior will be **fixed in .NET 9 SDK RC2** release +This behavior will be **fixed in an upcoming Visual Studio 17.11.x** release From 9a2c7349955114f4f9695b1fe12321762725e96a Mon Sep 17 00:00:00 2001 From: Marc Paine Date: Mon, 9 Sep 2024 13:13:48 -0700 Subject: [PATCH 4/4] Fix all of the linter flagged issues --- release-notes/9.0/known-issues.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/release-notes/9.0/known-issues.md b/release-notes/9.0/known-issues.md index 1b595fff24..4e4f3725e9 100644 --- a/release-notes/9.0/known-issues.md +++ b/release-notes/9.0/known-issues.md @@ -4,11 +4,12 @@ You may encounter the following known issues, which may include workarounds, mit ## .NET WPF -#### 1. Usage of incorrect types as DynamicResource -In earlier previews (or .NET 8 and before), applications that attempted to use a `DynamicResource` with incorrect types, and referenced the same from a library, would silently fail by swallowing the exception. However, with the introduction of DynamicResource optimization [here](https://github.com/dotnet/wpf/pull/5610), this behavior has changed. The same implementation will now result in a `XamlParseException` being thrown, potentially causing the application to crash. +### 1. Usage of incorrect types as DynamicResource +In earlier previews (or .NET 8 and before), applications that attempted to use a `DynamicResource` with incorrect types, and referenced the same from a library, would silently fail by swallowing the exception. However, with the introduction of DynamicResource optimization [here](https://github.com/dotnet/wpf/pull/5610), this behavior has changed. +The same implementation will now result in a `XamlParseException` being thrown, potentially causing the application to crash. The crash might look something like this: -``` +```cs PresentationFramework.dll!System.Windows.Markup.XamlReader.RewrapException(System.Exception e, System.Xaml.IXamlLineInfo lineInfo, System.Uri baseUri) PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader xamlReader, System.Xaml.IXamlObjectWriterFactory writerFactory, bool skipJournaledProperties, object rootObject, System.Xaml.XamlObjectWriterSettings settings, System.Uri baseUri) PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader xamlReader, bool skipJournaledProperties, object rootObject, System.Xaml.Permissions.XamlAccessLevel accessLevel, System.Uri baseUri) @@ -16,14 +17,14 @@ PresentationFramework.dll!System.Windows.Markup.XamlReader.LoadBaml(System.IO.St PresentationFramework.dll!System.Windows.Application.LoadComponent(object component, System.Uri resourceLocator) ``` -#### Mitigation: +### Mitigation Developers can prevent this crash by updating the resource with the correct value types. However, for those who need to maintain the previous behavior, an **opt-out switch** is being provided in the .NET 9 RC1 release. This switch allows applications to revert to the unoptimized `DynamicResource` usage. -#### 2. Incorrect rendering of applications launched with dark theme +### 2. Incorrect rendering of applications launched with dark theme Applications using library-based themes might encounter incorrect rendering of the dark theme due to the implementation of the `Fluent` theme. This could result in incorrect resource settings for windows, such as background and accent colors, which may appear transparent. -#### Available Workaround: +### Available Workaround This issue occurs only when starting the application with the dark theme enabled. To ensure correct rendering, the resources can be reloaded. This reloading process can be implemented by hooking into a window event, such as `ContentRendered`. The implementation for the same would look something like this - @@ -42,11 +43,12 @@ The behavior will be **fixed in .NET 9 RC1** release. ## .NET SDK -#### .NET 9.0.100-RC.1 will fail when used with 17.11 +### .NET 9.0.100-RC.1 will fail when used with 17.11 There is an incompatible dependency between a file loaded from the SDK and the dependencies that Visual Studio includes. -``` +` NETSDK1060 Error reading assets file: Error loading lock file '...\obj\project.assets.json' : Could not load file or assembly 'System.Text.Json, Version=8.0.0.4, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. -``` +` + This behavior will be **fixed in an upcoming Visual Studio 17.11.x** release