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

Unable to deploy RNW app after upgrade to VS 17.10.2 #13339

Closed
jonthysell opened this issue Jun 12, 2024 · 21 comments · Fixed by #13455
Closed

Unable to deploy RNW app after upgrade to VS 17.10.2 #13339

jonthysell opened this issue Jun 12, 2024 · 21 comments · Fixed by #13455
Assignees
Labels
Blocking High severity blocker issue 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

@jonthysell
Copy link
Contributor

jonthysell commented Jun 12, 2024

This bug was finally fixed in VS 17.11.0. Please upgrade to VS 17.11.0. Previous workaround below:

Previous Workaround: You can still open and deploy the app manually using Visual Studio. As long as Metro is running with yarn start you can then open your app's windows\YourAppName.sln file and press F5 to build and deploy the app successfully.

Problem Description

Trying to build/launch/deploy a RNW app with run-windows gives the following error:

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.ExportProvider.TryGetExports(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.10.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 E:/code/testnugets/windows/testnugets.Package/bin/x64/Debug/testnugets.Package.build.appxrecipe - exit error code 100

Steps To Reproduce

  1. Make sure latest VS 17.10.2 is installed
  2. Run npx react-native run-windows --logging in an RNW app

Expected Results

App deploys and launches

CLI version

14.0.0-alpha.2

Environment

info Fetching system and libraries information...
System:
  OS: Windows 11 10.0.22631
  CPU: "(24) x64 AMD Ryzen Threadripper PRO 3945WX 12-Cores     "
  Memory: 53.52 GB / 63.86 GB
Binaries:
  Node:
    version: 18.18.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.22
    path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
  npm:
    version: 9.8.1
    path: 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
      - 10.0.22621.0
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 17.10.35004.147 (Visual Studio Enterprise 2022)
Languages:
  Java: Not Found
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Community Modules

No response

Target Platform Version

10.0.22621

Target Device(s)

Desktop

Visual Studio Version

Visual Studio 2022

Build Configuration

Debug

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

No response

@jonthysell jonthysell added 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 labels Jun 12, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Jun 12, 2024
@jonthysell
Copy link
Contributor Author

This appears to be a recurring phenomenon with VS upgrades, see #10155.

@jonthysell jonthysell changed the title Unable to deploy debug RNW app after upgrade to VS 17.10.2 Unable to deploy RNW app after upgrade to VS 17.10.2 Jun 12, 2024
@chrisglein chrisglein added this to the Next milestone Jun 13, 2024
@chrisglein
Copy link
Member

As this looks similar to what cropped up 2 years ago: #10155 (comment)

@srdjanjovcic could you please take a look? It looks like DeployAppRecipe is failing again.

@chrisglein chrisglein removed the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Jun 13, 2024
jonthysell added a commit that referenced this issue Jun 13, 2024
Reverting our CI/PR agent images to an older version of VS 2022, specficially 17.9.7, due build failures introduced by the (automatic) upgrade to 17.10.2. See issue #13339 as an example.

Note this PR does not cause our images to change, this is just a backup of the agent image config which we keep and version here to track what is being used in Azure.
@Kamek437
Copy link

Do you have any idea on this one? I'm on 17.10.2, should I install a different version?

@abepuentes
Copy link

VS Profesional fixed version 17.9.7 is working for me, you can find it here https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-history

@jonthysell jonthysell modified the milestones: Next, 0.75 Jun 17, 2024
@jonthysell
Copy link
Contributor Author

The problem appears to be a bug in the DeployAppRecipe.exe tool we use to deploy the app. I can repro the error by calling it directly with our appxrecipe:

"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\DeployAppRecipe.exe" "E:\code\rnw\packages\e2e-test-app\windows\RNTesterApp\bin\x64\Debug\RNTesterApp.build.appxrecipe"

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.ExportProvider.TryGetExports(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.10.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()

@jonthysell
Copy link
Contributor Author

We're currently working on a solution with the Visual Studio team, the best current workaround is at the top of the bug description.

jonthysell added a commit that referenced this issue Jun 20, 2024
Reverting our CI/PR agent images to an older version of VS 2022, specifically 17.9.7, due build failures introduced by the (automatic) upgrade to 17.10.2. See issue #13339 as an example.

Note this PR does not cause our images to change, this is just a backup of the agent image config which we keep and version here to track what is being used in Azure.
@jonthysell
Copy link
Contributor Author

jonthysell commented Jun 20, 2024

The bug appears to be fixed in the next VS 2022 Preview release, version 17.11.0, but that's not out yet and it has its own issues: #13374

jonthysell added a commit that referenced this issue Jun 21, 2024
…` to use a particular version of VS installed (#13373)

## Description

Fixes a bug in `run-windows` where we truncate the minimum VS version number so it only allows for one digit minor versions.

We try to detect when building inside a VS command prompt by looking for the `VisualStudioVersion` environment variable. In this way we can make sure to use specific (usually prerelease/preview) versions of VS.

However, we can also set this env variable manually, which I was trying to do. However, there are lots of other places in VS that read this value, and it always expects a major version with a 0 minor version (i.e. `17.0`, `18.0`). When setting `17.11`, (the version I'm trying to test for has fixes to #13339) the code was truncating it to `17.1`. Even fixing the truncation meant that the build would later fail anyway, since it wasn't a  `X.0` number.

So this PR not only fixes the truncating code to keep `17.11` as `17.11`, but also adds a *new* env variable to check for, i.e. `MinimumVisualStudioVersion`, so that we can safely override that without breaking the build.

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
Trying to test with VS 17.11 preview, the number kept getting truncated to 17.1. I need a way of specify the version I want without breaking the build

### What
Fixes the version range calculating code to not truncate the digits, adds new `MinimumVisualStudioVersion` env variable.

## Screenshots
N/A

## Testing
Verified run-windows could fine the preview 17.11 over the regular 17.10 installed.

## Changelog
Should this change be included in the release notes: yes

Added `MinimumVisualStudioVersion` env variable to force `run-windows` to use a particular version of VS installed
jonthysell added a commit to jonthysell/react-native-windows that referenced this issue Jun 24, 2024
…windows` to use a particular version of VS installed

This PR backports microsoft#13373 to 0.74.

## Description

Fixes a bug in `run-windows` where we truncate the minimum VS version number so it only allows for one digit minor versions.

We try to detect when building inside a VS command prompt by looking for the `VisualStudioVersion` environment variable. In this way we can make sure to use specific (usually prerelease/preview) versions of VS.

However, we can also set this env variable manually, which I was trying to do. However, there are lots of other places in VS that read this value, and it always expects a major version with a 0 minor version (i.e. `17.0`, `18.0`). When setting `17.11`, (the version I'm trying to test for has fixes to microsoft#13339) the code was truncating it to `17.1`. Even fixing the truncation meant that the build would later fail anyway, since it wasn't a  `X.0` number.

So this PR not only fixes the truncating code to keep `17.11` as `17.11`, but also adds a *new* env variable to check for, i.e. `MinimumVisualStudioVersion`, so that we can safely override that without breaking the build.

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
Trying to test with VS 17.11 preview, the number kept getting truncated to 17.1. I need a way of specify the version I want without breaking the build

### What
Fixes the version range calculating code to not truncate the digits, adds new `MinimumVisualStudioVersion` env variable.

## Screenshots
N/A

## Testing
Verified run-windows could fine the preview 17.11 over the regular 17.10 installed.

## Changelog
Should this change be included in the release notes: yes

Added `MinimumVisualStudioVersion` env variable to force `run-windows` to use a particular version of VS installed
jonthysell added a commit that referenced this issue Jun 26, 2024
…windows` to use a particular version of VS installed (#13380)

This PR backports #13373 to 0.74.

## Description

Fixes a bug in `run-windows` where we truncate the minimum VS version number so it only allows for one digit minor versions.

We try to detect when building inside a VS command prompt by looking for the `VisualStudioVersion` environment variable. In this way we can make sure to use specific (usually prerelease/preview) versions of VS.

However, we can also set this env variable manually, which I was trying to do. However, there are lots of other places in VS that read this value, and it always expects a major version with a 0 minor version (i.e. `17.0`, `18.0`). When setting `17.11`, (the version I'm trying to test for has fixes to #13339) the code was truncating it to `17.1`. Even fixing the truncation meant that the build would later fail anyway, since it wasn't a  `X.0` number.

So this PR not only fixes the truncating code to keep `17.11` as `17.11`, but also adds a *new* env variable to check for, i.e. `MinimumVisualStudioVersion`, so that we can safely override that without breaking the build.

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
Trying to test with VS 17.11 preview, the number kept getting truncated to 17.1. I need a way of specify the version I want without breaking the build

### What
Fixes the version range calculating code to not truncate the digits, adds new `MinimumVisualStudioVersion` env variable.

## Screenshots
N/A

## Testing
Verified run-windows could fine the preview 17.11 over the regular 17.10 installed.

## Changelog
Should this change be included in the release notes: yes

Added `MinimumVisualStudioVersion` env variable to force `run-windows` to use a particular version of VS installed
@chrisglein chrisglein pinned this issue Jun 26, 2024
@jonthysell
Copy link
Contributor Author

This fix for this will be in VS 17.10.4.

@jonthysell
Copy link
Contributor Author

Tried to bump us to 17.10.4, but it looks like it breaks our native unit tests: https://developercommunity.visualstudio.com/t/VS2022-17101-throws-an-error-in-Azure-/10678969

So end users should be unblocked by 17.10.4, but we can't update the repo until maybe 17.10.5.

@Kamek437
Copy link

:(

@lgarcia-sfisas
Copy link

I am on version 17.10.5 and I still have the same problem.

Alternative solution to waiting for a new version ?

@Kamek437
Copy link

Kamek437 commented Jul 28, 2024

You have to let it fail, then open Visual Studio without closing the window that comes up, and then hit deploy in vs and it will put an entry in your start menu that will work. That's what I do. Please give us normal exe's in the future this is rediculous.

@jonthysell
Copy link
Contributor Author

I am on version 17.10.5 and I still have the same problem.

Alternative solution to waiting for a new version ?

sigh Confirming that 17.10.5 breaks it again. :(

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)
ERROR: Exceptions from the reflection loader:
   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.ExportProvider.TryGetExports(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: FileLoadException: Could not load file or assembly 'NuGet.VisualStudio.Contracts, Version=17.10.1.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()

@Kamek437
Copy link

Kamek437 commented Aug 6, 2024

I don't understand how this is happening, can someone explain?

@srdjanjovcic
Copy link
Member

Unfortunately, fix in 17.10.4 was a partial one, and we received another dependency update in 17.10.5, regressing us. Proper fix is deployed to 17.10.7, 17.11.0 (available yesterday), and Preview 17.12.

Sorry for the randomization, and hope that you can move to latest public release (17.11.0) with a fix.

@jonthysell
Copy link
Contributor Author

I have confirmed that 17.11.0 fixes this issue (and other outstanding VS issues) for us. I'm updating our CI images to 17.11.0 now and PR #13455 will bump our dependency script to make sure you have 17.11.0 installed, but everyone should be safe to upgrade to 17.11.0 now. Sorry that this took so long to figure out.

@jonthysell
Copy link
Contributor Author

I don't understand how this is happening, can someone explain?

At the end of run-windows we call Visual Studio's DeployAppRecipe.exe tool in order to deploy (install) the newly built app to your system. Unfortunately there was some regression in that tool in newer VS 2022 versions (17.10.0-17.10.3, 17.10.4, 17.10.5) that broke us.

@Kamek437
Copy link

I see, well thanks guys keep up the great work!

jonthysell added a commit to jonthysell/react-native-windows that referenced this issue Aug 16, 2024
This PR backports microsoft#13455 to 0.75.

## Description

This PR bumps the minimum version of VS that RNW expects to 17.11.0.

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
To make sure users don't use the regressed builds of VS 2022.

Resolves microsoft#13339
Resolves microsoft#13374

### What
Bumped VS version checks for `run-windows` and `rnw-dependencies.ps1`. Updated ADO image to reflect updated images are no longer locked to VS v17.9.4.

## Screenshots
N/A

## Testing
`run-windows` now works with 17.11.0.

## Changelog
Should this change be included in the release notes: _yes_

Require Visual Studio 2022 >= v17.11.0
jonthysell added a commit to jonthysell/react-native-windows that referenced this issue Aug 16, 2024
This PR backports microsoft#13455 to 0.74.

This PR bumps the minimum version of VS that RNW expects to 17.11.0.
- Bug fix (non-breaking change which fixes an issue)
To make sure users don't use the regressed builds of VS 2022.

Resolves microsoft#13339
Resolves microsoft#13374
Bumped VS version checks for `run-windows` and `rnw-dependencies.ps1`. Updated ADO image to reflect updated images are no longer locked to VS v17.9.4.
N/A
`run-windows` now works with 17.11.0.
Should this change be included in the release notes: _yes_

Require Visual Studio 2022 >= v17.11.0
jonthysell added a commit to jonthysell/react-native-windows that referenced this issue Aug 16, 2024
This PR backports microsoft#13455 to 0.74.

This PR bumps the minimum version of VS that RNW expects to 17.11.0.
- Bug fix (non-breaking change which fixes an issue)
To make sure users don't use the regressed builds of VS 2022.

Resolves microsoft#13339
Resolves microsoft#13374
Bumped VS version checks for `run-windows` and `rnw-dependencies.ps1`. Updated ADO image to reflect updated images are no longer locked to VS v17.9.4.
N/A
`run-windows` now works with 17.11.0.
Should this change be included in the release notes: _yes_

Require Visual Studio 2022 >= v17.11.0
jonthysell added a commit to jonthysell/react-native-windows that referenced this issue Aug 16, 2024
This PR backports microsoft#13455 to 0.73.

## Description

This PR bumps the minimum version of VS that RNW expects to 17.11.0.

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
To make sure users don't use the regressed builds of VS 2022.

Resolves microsoft#13339
Resolves microsoft#13374

### What
Bumped VS version checks for `run-windows` and `rnw-dependencies.ps1`. Updated ADO image to reflect updated images are no longer locked to VS v17.9.4.

## Screenshots
N/A

## Testing
`run-windows` now works with 17.11.0.

## Changelog
Should this change be included in the release notes: _yes_

Require Visual Studio 2022 >= v17.11.0
jonthysell added a commit to jonthysell/react-native-windows that referenced this issue Aug 16, 2024
This PR backports microsoft#13455 to 0.72.

## Description

This PR bumps the minimum version of VS that RNW expects to 17.11.0.

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
To make sure users don't use the regressed builds of VS 2022.

Resolves microsoft#13339
Resolves microsoft#13374

### What
Bumped VS version checks for `run-windows` and `rnw-dependencies.ps1`. Updated ADO image to reflect updated images are no longer locked to VS v17.9.4.

## Screenshots
N/A

## Testing
`run-windows` now works with 17.11.0.

## Changelog
Should this change be included in the release notes: _yes_

Require Visual Studio 2022 >= v17.11.0
jonthysell added a commit to jonthysell/react-native-windows that referenced this issue Aug 16, 2024
…` to use a particular version of VS installed (microsoft#13373)

## Description

Fixes a bug in `run-windows` where we truncate the minimum VS version number so it only allows for one digit minor versions.

We try to detect when building inside a VS command prompt by looking for the `VisualStudioVersion` environment variable. In this way we can make sure to use specific (usually prerelease/preview) versions of VS.

However, we can also set this env variable manually, which I was trying to do. However, there are lots of other places in VS that read this value, and it always expects a major version with a 0 minor version (i.e. `17.0`, `18.0`). When setting `17.11`, (the version I'm trying to test for has fixes to microsoft#13339) the code was truncating it to `17.1`. Even fixing the truncation meant that the build would later fail anyway, since it wasn't a  `X.0` number.

So this PR not only fixes the truncating code to keep `17.11` as `17.11`, but also adds a *new* env variable to check for, i.e. `MinimumVisualStudioVersion`, so that we can safely override that without breaking the build.

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
Trying to test with VS 17.11 preview, the number kept getting truncated to 17.1. I need a way of specify the version I want without breaking the build

### What
Fixes the version range calculating code to not truncate the digits, adds new `MinimumVisualStudioVersion` env variable.

## Screenshots
N/A

## Testing
Verified run-windows could fine the preview 17.11 over the regular 17.10 installed.

## Changelog
Should this change be included in the release notes: yes

Added `MinimumVisualStudioVersion` env variable to force `run-windows` to use a particular version of VS installed
jonthysell added a commit that referenced this issue Aug 16, 2024
This PR backports #13455 to 0.75.

## Description

This PR bumps the minimum version of VS that RNW expects to 17.11.0.

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
To make sure users don't use the regressed builds of VS 2022.

Resolves #13339
Resolves #13374

### What
Bumped VS version checks for `run-windows` and `rnw-dependencies.ps1`. Updated ADO image to reflect updated images are no longer locked to VS v17.9.4.

## Screenshots
N/A

## Testing
`run-windows` now works with 17.11.0.

## Changelog
Should this change be included in the release notes: _yes_

Require Visual Studio 2022 >= v17.11.0
jonthysell added a commit that referenced this issue Aug 16, 2024
This PR backports #13455 to 0.73.

## Description

This PR bumps the minimum version of VS that RNW expects to 17.11.0.

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
To make sure users don't use the regressed builds of VS 2022.

Resolves #13339
Resolves #13374

### What
Bumped VS version checks for `run-windows` and `rnw-dependencies.ps1`. Updated ADO image to reflect updated images are no longer locked to VS v17.9.4.

## Screenshots
N/A

## Testing
`run-windows` now works with 17.11.0.

## Changelog
Should this change be included in the release notes: _yes_

Require Visual Studio 2022 >= v17.11.0
jonthysell added a commit that referenced this issue Aug 16, 2024
This PR backports #13455 to 0.74.

## Description

This PR bumps the minimum version of VS that RNW expects to 17.11.0.

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
To make sure users don't use the regressed builds of VS 2022.

Resolves #13339
Resolves #13374

### What
Bumped VS version checks for `run-windows` and `rnw-dependencies.ps1`. Updated ADO image to reflect updated images are no longer locked to VS v17.9.4.

## Screenshots
N/A

## Testing
`run-windows` now works with 17.11.0.

## Changelog
Should this change be included in the release notes: _yes_

Require Visual Studio 2022 >= v17.11.0
jonthysell added a commit that referenced this issue Aug 20, 2024
This PR backports #13455 to 0.72.

## Description

This PR bumps the minimum version of VS that RNW expects to 17.11.0.

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
To make sure users don't use the regressed builds of VS 2022.

Resolves #13339
Resolves #13374

### What
Bumped VS version checks for `run-windows` and `rnw-dependencies.ps1`. Updated ADO image to reflect updated images are no longer locked to VS v17.9.4.

## Screenshots
N/A

## Testing
`run-windows` now works with 17.11.0.

## Changelog
Should this change be included in the release notes: _yes_

Require Visual Studio 2022 >= v17.11.0
@jonthysell jonthysell unpinned this issue Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocking High severity blocker issue 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

Successfully merging a pull request may close this issue.

8 participants