Repository navigation
Update E2E WebApplication templates to fix tests errors in project creation - #7208
Merged
Merged
Conversation
Contributor
Author
nkolev92
previously approved these changes
Mar 11, 2026
donnie-msft
reviewed
Mar 11, 2026
donnie-msft
left a comment
Contributor
There was a problem hiding this comment.
Looks like a lot of investigation has taken place. Thanks for writing that up! I have a couple questions around how this all works.
Contributor
Author
|
Tests are no longer failing to the Unable to create Project error https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=13564562&view=results |
nkolev92
approved these changes
Mar 16, 2026
martinrrm
enabled auto-merge (squash)
March 16, 2026 21:13
This was referenced Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
Fixes:
Description
1. Fix legacy web project templates so they work under VS 18
Some E2E tests create legacy ASP.NET web application projects through DTE using the templates under:
test\EndToEnd\ProjectTemplates\EmptyWebApplicationProject40.ziptest\EndToEnd\ProjectTemplates\WebApplicationProject40.zipThe failing tests were surfacing this error:
Operation could not be completed. The project file '...EmptyWebApplicationProject40_070f.csproj' cannot be migrated. See the migration report for details.
That message is misleading. The project was not actually failing because of a real project migration problem.
The real issue was that the legacy templates were hard-coding the VS 17 web targets path:
That works when the test runs against VS 17, but it breaks when the E2E harness uses VS 18. Under VS 18, the targets live under v18.0, so the project creation flow fails
while Visual Studio is creating the temp project from the template, and DTE surfaces that inner import failure as a generic "cannot be migrated" error.
This PR updates both templates to resolve the web targets dynamically through$(VisualStudioVersion) / $ (VSToolsPath) instead:
This keeps the old template behavior but allows the same asset to resolve correctly when the tests run against newer Visual Studio instances.
2. Fix InstallPackagesConfigLocal by packaging the current test metadata into EndToEnd.zip
`
Test-InstallPackagesConfigLocal expects the local packages.config scenario to install packages A and B:
$pathToPackagesConfig = Join-Path $context.RepositoryRoot "InstallPackagesConfigLocal\packages.config"
$p | Install-Package $pathToPackagesConfig
Assert-Package $p A 1.0.0
Assert-Package $p B 1.0.0
`
The source-controlled test data for that scenario is:
However, the generated runnable E2E bundle (EndToEnd.zip) was not reliably using the current test\EndToEnd\Packages metadata. Instead, CreateEndToEndTestPackage.proj was
filling the bundled Packages folder from the restored NuGet.Client.EndToEnd.TestData package, which still contained stale scenario metadata.
That meant the runnable test bundle had drifted from source control. The failure:
Value is null. Package A 1.0.0 is not referenced in ClassLibrary_f4c0.was only the symptom. The real problem was that the assembled E2E environment was not feeding the test the expected packages.config, so A was never installed in the first place.
The packaging logic previously did this:
This PR keeps that copy, but then overlays the current source-controlled test\EndToEnd\Packages content on top of it:
This is intentionally narrow:
PR Checklist