From f9c676b86d2a0ae0b03dc2c7c853993d68b38c08 Mon Sep 17 00:00:00 2001 From: Alex Ghiondea Date: Mon, 19 Mar 2018 21:42:16 -0700 Subject: [PATCH 1/3] Create 553390 - BCL - SGEN crashes because it references System.IO.Compression.ZipFile.dll.md --- ...ences System.IO.Compression.ZipFile.dll.md | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 releases/net471/KnownIssues/553390 - BCL - SGEN crashes because it references System.IO.Compression.ZipFile.dll.md diff --git a/releases/net471/KnownIssues/553390 - BCL - SGEN crashes because it references System.IO.Compression.ZipFile.dll.md b/releases/net471/KnownIssues/553390 - BCL - SGEN crashes because it references System.IO.Compression.ZipFile.dll.md new file mode 100644 index 000000000..20c9d6462 --- /dev/null +++ b/releases/net471/KnownIssues/553390 - BCL - SGEN crashes because it references System.IO.Compression.ZipFile.dll.md @@ -0,0 +1,48 @@ +# SGEN crashes trying to load the System.IO.Compression.FileSystem reference assembly + +## Symptoms + +When building an application that uses SGEN you will get an error similar to this one: + +``` +An attempt was made to load an assembly with an incorrect format: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\Facades\System.IO.Compression.ZipFile.dll. +``` + +## Cause + +.NET Framework 4.7.1 includes a few new assemblies in order to support .NET Standard 2.0. +For those assemblies, we added entries in a .NET Framework unification table to ensure that assemblies with different versions will correctly unify to a single one. +For the `System.IO.Compression.FileSystem` the information captured in the unification table is incorrect. + +This causes the assembly to not be correctly unified by the .NET Framework and in turn causes SGEN to give out that error. + +## Impact + +This problem occurs during the build of applications that use the SGEN tool. + +## Workaround + +Add the following targets to the project that is experiencing this issue. +The targets will remove the reference assemblies from the ReferecenPath set that SGEN uses before the serialization assemblies are produced and will add them back after they are produced. + +```xml + + + + <_FilterOutFromReferencePath Include="@(_DesignTimeFacadeAssemblies_Names->'%(OriginalIdentity)')" + Condition="'@(DesignFacadesToFilter)' == '@(_DesignTimeFacadeAssemblies_Names)' and '%(Identity)' != ''" /> + + + + + + + + + + +``` + +## Resolution + +This problem is fixed in [.NET Framework 4.7.2](http://go.microsoft.com/fwlink/?LinkId=863281). From c6cfd9cfda593813955aea5a460ff2f575d1b4b4 Mon Sep 17 00:00:00 2001 From: Alex Ghiondea Date: Tue, 20 Mar 2018 13:19:48 -0700 Subject: [PATCH 2/3] Update 553390 - BCL - SGEN crashes because it references System.IO.Compression.ZipFile.dll.md --- ...cause it references System.IO.Compression.ZipFile.dll.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/releases/net471/KnownIssues/553390 - BCL - SGEN crashes because it references System.IO.Compression.ZipFile.dll.md b/releases/net471/KnownIssues/553390 - BCL - SGEN crashes because it references System.IO.Compression.ZipFile.dll.md index 20c9d6462..2516c632c 100644 --- a/releases/net471/KnownIssues/553390 - BCL - SGEN crashes because it references System.IO.Compression.ZipFile.dll.md +++ b/releases/net471/KnownIssues/553390 - BCL - SGEN crashes because it references System.IO.Compression.ZipFile.dll.md @@ -2,7 +2,7 @@ ## Symptoms -When building an application that uses SGEN you will get an error similar to this one: +When building an application that uses the XML Serializer Generator Tools ([SGen.exe](https://docs.microsoft.com/en-us/dotnet/standard/serialization/xml-serializer-generator-tool-sgen-exe)), you get an error similar to this one: ``` An attempt was made to load an assembly with an incorrect format: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\Facades\System.IO.Compression.ZipFile.dll. @@ -18,12 +18,12 @@ This causes the assembly to not be correctly unified by the .NET Framework and i ## Impact -This problem occurs during the build of applications that use the SGEN tool. +This problem occurs when building the applications that use the SGEN tool. ## Workaround Add the following targets to the project that is experiencing this issue. -The targets will remove the reference assemblies from the ReferecenPath set that SGEN uses before the serialization assemblies are produced and will add them back after they are produced. +The targets remove the reference assemblies from the ReferencePath set that SGEN uses before the serialization assemblies are produced and adds them back after they are produced. ```xml From 88bfdffe356383682fad077116ce0022e6441711 Mon Sep 17 00:00:00 2001 From: Ron Petrusha Date: Tue, 20 Mar 2018 13:23:49 -0700 Subject: [PATCH 3/3] Update 553390 - BCL - SGEN crashes because it references System.IO.Compression.ZipFile.dll.md --- ...s because it references System.IO.Compression.ZipFile.dll.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/releases/net471/KnownIssues/553390 - BCL - SGEN crashes because it references System.IO.Compression.ZipFile.dll.md b/releases/net471/KnownIssues/553390 - BCL - SGEN crashes because it references System.IO.Compression.ZipFile.dll.md index 2516c632c..ff72e19c1 100644 --- a/releases/net471/KnownIssues/553390 - BCL - SGEN crashes because it references System.IO.Compression.ZipFile.dll.md +++ b/releases/net471/KnownIssues/553390 - BCL - SGEN crashes because it references System.IO.Compression.ZipFile.dll.md @@ -2,7 +2,7 @@ ## Symptoms -When building an application that uses the XML Serializer Generator Tools ([SGen.exe](https://docs.microsoft.com/en-us/dotnet/standard/serialization/xml-serializer-generator-tool-sgen-exe)), you get an error similar to this one: +When building an application that uses the [XML Serializer Generator Tool (SGen.exe)](https://docs.microsoft.com/en-us/dotnet/standard/serialization/xml-serializer-generator-tool-sgen-exe), you get an error similar to this one: ``` An attempt was made to load an assembly with an incorrect format: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.1\Facades\System.IO.Compression.ZipFile.dll.