Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on trying to follow "Get Started With Windows" instructions #10155

Closed
edzhuang opened this issue Jun 19, 2022 · 11 comments
Closed

Error on trying to follow "Get Started With Windows" instructions #10155

edzhuang opened this issue Jun 19, 2022 · 11 comments
Assignees
Labels
bug Developer First Experience Issues that are going to be hit by a new developer as they first try out RNW External Developer Tooling Issue caused by the tool chain, not by RNW itself Scenario: Visual Studio
Milestone

Comments

@edzhuang
Copy link

Problem Description

When running the app in visual studio code, I encountered an error.

Steps To Reproduce

  1. Follow the instructions here https://microsoft.github.io/react-native-windows/docs/getting-started and run on visual studio code

Expected Results

The app running.

CLI version

7.0.3

Environment

System:
    OS: Windows 10 10.0.22000
    CPU: (6) x64 Intel(R) Core(TM) i5-9400 CPU @ 2.90GHz
    Memory: 7.23 GB / 15.83 GB
  Binaries:
    Node: 16.14.2 - D:\Program Files\nodejs\node.EXE
    Yarn: 1.22.15 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 8.9.0 - D:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
    Windows SDK:
      AllowAllTrustedApps: Enabled
      AllowDevelopmentWithoutDevLicense: Enabled
      Versions: 10.0.16299.0, 10.0.18362.0, 10.0.19041.0, 10.0.22616.0
  IDEs:
    Android Studio: Not Found
    Visual Studio: 16.11.32602.291 (Visual Studio Community 2019), 17.2.32602.215 (Visual Studio Community 2022)
  Languages:
    Java: 11.0.14.1 - C:\Program Files\OpenJDK\openjdk-11.0.14.1_1\bin\javac.EXE
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2
    react-native: 0.68.0 => 0.68.0
    react-native-windows: 0.68.5 => 0.68.5
  npmGlobalPackages:
    *react-native*: Not Found

Target Platform Version

No response

Target Device(s)

Desktop

Visual Studio Version

No response

Build Configuration

Debug

Snack, code example, screenshot, or link to a repository

Here is the output of react-native run-windows --logging.

Utilization:          99.9     Average Utilization: 99.9
√ Building Solution
 √ React-Native Server already started
 √ Enabling Developer Mode
 ERROR: ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.Assembly.GetTypes()
   at System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_InnerCatalog()
   at System.ComponentModel.Composition.Hosting.AssemblyCatalog.GetExports(ImportDefinition definition)
   at System.ComponentModel.Composition.Hosting.AggregateCatalog.GetExports(ImportDefinition definition)
   at System.ComponentModel.Composition.Hosting.CatalogExportProvider.InternalGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExports(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   at System.ComponentModel.Composition.Hosting.AggregateExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   at System.ComponentModel.Composition.Hosting.CompositionContainer.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ImportEngine.TryGetExports(ExportProvider provider, ComposablePart part, ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportSubset(PartManager partManager, IEnumerable`1 imports, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ImportEngine.TryPreviewImportsStateMachine(PartManager partManager, ComposablePart part, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ImportEngine.PreviewImports(ComposablePart part, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.Compose(CompositionBatch batch)
   at Microsoft.VisualStudio.Deployment.Deployer.Deploy()
ERROR: Exceptions from the reflection loader:
ERROR: FileLoadException: Could not load file or assembly 'NuGet.VisualStudio.Contracts, Version=17.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
ERROR: ArgumentNullException: Value cannot be null.
Parameter name: format
   at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.Format(IFormatProvider provider, String format, Object[] args)
   at System.IO.TextWriter.WriteLine(String format, Object[] arg)
   at System.IO.TextWriter.SyncTextWriter.WriteLine(String format, Object[] arg)
   at System.Console.WriteLine(String format, Object[] arg)
   at Microsoft.VisualStudio.Deployment.Deployer.Microsoft.VisualStudio.Deployment.ILogger.Log(Level level, String format, Object[] args)
   at Microsoft.VisualStudio.Deployment.Deployer.Deploy()
× Deploying
 × Failed to deploy: Deploying D:\Users\zhuan\GeekyStuff\WebDev\facetouching\windows\x64\Debug\facetouching\facetouching.build.appxrecipe - exit error code 100
 i Gathering MSBuild data for telemetry.
 i Loading properties from msbuildproperties.g.json
Command failed with error DeployRecipeFailure: Deploying D:\Users\zhuan\GeekyStuff\WebDev\facetouching\windows\x64\Debug\facetouching\facetouching.build.appxrecipe - exit error code 100
Your telemetry sessionId was 4b74f3768e0ce19af2a4d5123de38325
@edzhuang edzhuang added the bug label Jun 19, 2022
@ghost ghost added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Jun 19, 2022
@0xZXDX
Copy link

0xZXDX commented Jun 20, 2022

Me too

info Fetching system and libraries information...
System:
    OS: Windows 10 10.0.22000
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
    Memory: 9.22 GB / 15.62 GB
  Binaries:
    Node: 16.15.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.11.0 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
    Windows SDK:
      AllowDevelopmentWithoutDevLicense: Enabled
      AllowAllTrustedApps: Enabled
      Versions: 10.0.19041.0
  IDEs:
    Android Studio: Not Found
    Visual Studio: 17.2.32602.215 (Visual Studio Community 2022)
  Languages:
    Java: Not Found
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2
    react-native: 0.68.0 => 0.68.0
    react-native-windows: 0.68.5 => 0.68.5
  npmGlobalPackages:
    *react-native*: Not Found
  -----------------------------------------------------------------------------------------------------------------------------------
  利用率:          99.7     平均利用率: 99.7
√ Building Solution
 √ Starting the React-Native Server
 √ Enabling Developer Mode
 错误: ReflectionTypeLoadException: 无法加载一个或多个请求的类型。有关更多信息,请检索 LoaderExceptions 属性。
   在 System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   在 System.Reflection.Assembly.GetTypes()
   在 System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_InnerCatalog()
   在 System.ComponentModel.Composition.Hosting.AssemblyCatalog.GetExports(ImportDefinition definition)
   在 System.ComponentModel.Composition.Hosting.AggregateCatalog.GetExports(ImportDefinition definition)
   在 System.ComponentModel.Composition.Hosting.CatalogExportProvider.InternalGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   在 System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   在 System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExports(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   在 System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   在 System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   在 System.ComponentModel.Composition.Hosting.AggregateExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   在 System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   在 System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExports(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   在 System.ComponentModel.Composition.Hosting.CompositionContainer.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   在 System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   在 System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition)
   在 System.ComponentModel.Composition.Hosting.ImportEngine.TryGetExports(ExportProvider provider, ComposablePart part, ImportDefinition definition, AtomicComposition atomicComposition)
   在 System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportSubset(PartManager partManager, IEnumerable`1 imports, AtomicComposition atomicComposition)
   在 System.ComponentModel.Composition.Hosting.ImportEngine.TryPreviewImportsStateMachine(PartManager partManager, ComposablePart part, AtomicComposition atomicComposition)
   在 System.ComponentModel.Composition.Hosting.ImportEngine.PreviewImports(ComposablePart part, AtomicComposition atomicComposition)
   在 System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.Compose(CompositionBatch batch)
   在 Microsoft.VisualStudio.Deployment.Deployer.Deploy()
错误: 反射加载程序中的异常:
错误: FileLoadException: 未能加载文件或程序集“NuGet.VisualStudio.Contracts, Version=17.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)
错误: ArgumentNullException: 值不能为 null。
参数名: format
   在 System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
   在 System.String.Format(IFormatProvider provider, String format, Object[] args)
   在 System.IO.TextWriter.WriteLine(String format, Object[] arg)
   在 System.IO.TextWriter.SyncTextWriter.WriteLine(String format, Object[] arg)
   在 System.Console.WriteLine(String format, Object[] arg)
   在 Microsoft.VisualStudio.Deployment.Deployer.Microsoft.VisualStudio.Deployment.ILogger.Log(Level level, String format, Object[] args)
   在 Microsoft.VisualStudio.Deployment.Deployer.Deploy()
× Deploying
 × Failed to deploy: Deploying C:\Users\ansheng\Desktop\app\windows\x64\Debug\app\app.build.appxrecipe - exit error code 100
 i Gathering MSBuild data for telemetry.
 i Loading properties from msbuildproperties.g.json
Command failed with error DeployRecipeFailure: Deploying C:\Users\ansheng\Desktop\app\windows\x64\Debug\app\app.build.appxrecipe - exit error code 100
Your telemetry sessionId was 398388f187a1051e07fd1f14f543484d

@chrisglein
Copy link
Member

The failure actually seems to be in Visual Studio deployment:

at Microsoft.VisualStudio.Deployment.Deployer.Deploy()

And it's happening within the Visual Studio 2022 version.
@asklar Can you loop in the right VS contact to help look at this?

@chrisglein chrisglein added Developer First Experience Issues that are going to be hit by a new developer as they first try out RNW Scenario: Visual Studio and removed Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) labels Jun 20, 2022
@chrisglein chrisglein added this to the 0.70 milestone Jun 20, 2022
@asklar
Copy link
Member

asklar commented Jun 20, 2022

@srdjanjovcic could you please take a look? It looks like DeployAppRecipe is failing for these customers.
@EdZ543 and @aansheng could you please file a ticket in Visual Studio? (Help->Send Feedback) and share the link?

@asklar asklar added the Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) label Jun 22, 2022
@asklar
Copy link
Member

asklar commented Jun 23, 2022

@EdZ543 @aansheng could you please try upgrading to VS 2022 17.2.5? we believe this is an issue with one specific VS version.

@edzhuang
Copy link
Author

I have upgraded and it indeed does work as intended now.

@ghost ghost added Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot) and removed Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) labels Jun 23, 2022
@ghost ghost removed the Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot) label Jun 23, 2022
@chrisglein chrisglein added the External Developer Tooling Issue caused by the tool chain, not by RNW itself label Jun 23, 2022
@Yajur-Grover
Copy link
Contributor

I am also hitting this issue when trying to build a Fabric app on RNW version canary-761 and running on VS 2022 17.8.7 (following the instructions to use the cpp-app template to create a new app here:

√ Building Solution
 √ Starting the React-Native Server
 √ Enabling Developer Mode
 ERROR: ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeModule.GetTypes()
   at System.Reflection.Assembly.GetTypes()
   at System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_InnerCatalog()
   at System.ComponentModel.Composition.Hosting.AssemblyCatalog.GetExports(ImportDefinition definition)
   at System.ComponentModel.Composition.Hosting.AggregateCatalog.GetExports(ImportDefinition definition)
   at System.ComponentModel.Composition.Hosting.CatalogExportProvider.InternalGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExports(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   at System.ComponentModel.Composition.Hosting.AggregateExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   at System.ComponentModel.Composition.Hosting.CompositionContainer.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ImportEngine.TryGetExports(ExportProvider provider, ComposablePart part, ImportDefinition definition, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ImportEngine.TrySatisfyImportSubset(PartManager partManager, IEnumerable`1 imports, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ImportEngine.TryPreviewImportsStateMachine(PartManager partManager, ComposablePart part, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ImportEngine.PreviewImports(ComposablePart part, AtomicComposition atomicComposition)
   at System.ComponentModel.Composition.Hosting.ComposablePartExportProvider.Compose(CompositionBatch batch)
   at Microsoft.VisualStudio.Deployment.Deployer.Deploy()
ERROR: Exceptions from the reflection loader:
ERROR: FileLoadException: Could not load file or assembly 'NuGet.VisualStudio.Contracts, Version=17.8.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
ERROR: ArgumentNullException: Value cannot be null.
Parameter name: format
   at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.Format(IFormatProvider provider, String format, Object[] args)
   at System.IO.TextWriter.WriteLine(String format, Object[] arg)
   at System.IO.TextWriter.SyncTextWriter.WriteLine(String format, Object[] arg)
   at System.Console.WriteLine(String format, Object[] arg)
   at Microsoft.VisualStudio.Deployment.Deployer.Microsoft.VisualStudio.Deployment.ILoggerSink.Log(Level level, String format, Object[] args)
   at Microsoft.VisualStudio.Deployment.Deployer.Deploy()
× Deploying
 × Failed to deploy: Deploying C:/Users/yajurgrover/new-account-repos/react-native-gallery/testFabric/windows/testFabric.Package/bin/x64/Debug/testFabric.Package.build.appxrecipe - exit error code 100
 i Gathering MSBuild data for telemetry.
 i Loading properties from msbuildproperties.g.json
Command failed with error DeployRecipeFailure: Deploying C:/Users/yajurgrover/new-account-repos/react-native-gallery/testFabric/windows/testFabric.Package/bin/x64/Debug/testFabric.Package.build.appxrecipe - exit error code 100
Your telemetry sessionId was 4c49a6aaa6b7c4cac75a944e96057f19
error Command failed with exit code 2412.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Updating VS 2022 version to 17.9.0 to see if that resolves the issue.

@Yajur-Grover
Copy link
Contributor

Yajur-Grover commented Feb 16, 2024

Updating VS 2022 version to 17.9.0 to see if that resolves the issue.

Upgrading to 17.9.0 resolves the issue for me - I am able to successfully build the app. Keeping the issue closed.

@jonthysell
Copy link
Contributor

And we're back with this failing in 17.10.2.

@jonthysell
Copy link
Contributor

Opened a new bug to track the current iteration of this.

@famaster
Copy link

how to fix this then? can you downgrade visual studio version?

@Kamek437
Copy link

Kamek437 commented Aug 13, 2024

After you try to build there will be a cmd.exe window open for debugging, when it's showing you open the project in visual studio and hit build and it will deploy to the cmd.exe window and run correctly. That's how it works for me anyway. Hopefully will be fixed then broken in the next update lol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Developer First Experience Issues that are going to be hit by a new developer as they first try out RNW External Developer Tooling Issue caused by the tool chain, not by RNW itself Scenario: Visual Studio
Projects
None yet
Development

No branches or pull requests

8 participants