Uno: Uno.UWPSyncGenerator does not work without Visual Studio 2017

Created on 20 Jul 2019  路  3Comments  路  Source: unoplatform/uno

Current behavior

Uno.UWPSyncGenerator crashes if Visual Studio 2017 is not installed on the developer PC.

Expected behavior

Uno.UWPSyncGenerator should run successfully.

How to reproduce it (as minimally and precisely as possible)

  1. Clean Windows 10, install Visual Studio 2019 with all required workloads 馃槉

  2. Clone Uno.UI

  3. Open Uno.UI.sln
  4. Run Uno.UWPSyncGenerator for debugging
  5. Observe the application crashes in Generator.cs on line 1415:

Exception detail:

System.Reflection.ReflectionTypeLoadException: 'Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.'

Stack trace:

at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeAssembly.get_DefinedTypes()
at System.Composition.Hosting.ContainerConfiguration.<>c.b__16_0(Assembly a)
at System.Linq.Enumerable.d__172.MoveNext() at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor(IEnumerable1 types, AttributedModelProvider attributeContext)
at System.Composition.Hosting.ContainerConfiguration.CreateContainer()
at Microsoft.CodeAnalysis.Host.Mef.MefHostServices.Create(IEnumerable1 assemblies) at Microsoft.CodeAnalysis.Host.Mef.MSBuildMefHostServices.get_DefaultServices() at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.Create(IDictionary2 properties)
at Uno.UWPSyncGenerator.Generator.LoadProject(String projectFile, String targetFramework)
at Uno.UWPSyncGenerator.Generator.Build(String basePath, String baseName, String sourceAssembly)
at Uno.UWPSyncGenerator.Program.Main(String[] args)

App output:

*** WARNING: Close all editor files in visual studio, otherwise VS will freeze for a few minutes ****
Press enter to continue...

Generating for Uno.Foundation Windows.Foundation.FoundationContract
Loading for : Uno.UWPSyncGenerator.Reference.csproj
Searching for [Microsoft.CodeAnalysis.Features, Version=2.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35] from [C:\Dev\Uno\src\Uno.UWPSyncGenerator\bin\Debug\net461]
Searching for [Microsoft.CodeAnalysis.CSharp.Features, Version=2.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35] from [C:\Dev\Uno\src\Uno.UWPSyncGenerator\bin\Debug\net461]
Searching for [Microsoft.CodeAnalysis.VisualBasic.Features, Version=2.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35] from [C:\Dev\Uno\src\Uno.UWPSyncGenerator\bin\Debug\net461]
Searching for [Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a] from [C:\Dev\Uno\src\Uno.UWPSyncGenerator\bin\Debug\net461]
Searching for [Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a] from [C:\Dev\Uno\src\Uno.UWPSyncGenerator\bin\Debug\net461]
Searching for [Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a] from [C:\Dev\Uno\src\Uno.UWPSyncGenerator\bin\Debug\net461]
Searching for [Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a] from [C:\Dev\Uno\src\Uno.UWPSyncGenerator\bin\Debug\net461]
Searching for [Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a] from [C:\Dev\Uno\src\Uno.UWPSyncGenerator\bin\Debug\net461]
Searching for [Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a] from [C:\Dev\Uno\src\Uno.UWPSyncGenerator\bin\Debug\net461]
Searching for [Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a] from [C:\Dev\Uno\src\Uno.UWPSyncGenerator\bin\Debug\net461]

Environment

Nuget Package:

Package Version(s):

Affected platform(s):

  • [ ] iOS
  • [ ] Android
  • [ ] WebAssembly
  • [ ] Windows
  • [ ] Build tasks

Visual Studio

  • [ ] 2017 (version: )
  • [x] 2019 (version: any, tested on 16.1.6)
  • [ ] for Mac (version: )

Relevant plugins

  • [ ] Resharper (version: )

Anything else we need to know?

arecode-generation arevswin kinbug

All 3 comments

Interestingly enough, the same problem remains even after installing Visual Studio 2017 after installing 2019 first. I will verify now if that is a consistent problem and then will do one more clean reinstall in the "correct" order (2017 first, 2019 second).

I can now confirm that when Visual Studio 2017 is installed first and Visual Studio 2019 second, the tool does not crash when launched from either of the IDEs.

This has been fixed since then (it also runs during parts of the CI now)

Was this page helpful?
0 / 5 - 0 ratings