Repository navigation
Standard VS scenarios should not load NuGet.VisualStudio.Internal.Contracts assembly - #3330
Conversation
dominoFire
left a comment
There was a problem hiding this comment.
Thanks for helping unblock tests.
| { | ||
| public static string NuGetSolutionServiceName = "NuGetSolutionService"; | ||
| public static string NuGetSolutionServiceVersion = "1.0.0"; | ||
| internal static string NuGetSolutionServiceName = "NuGetSolutionService"; |
There was a problem hiding this comment.
Add an unit test to compare these constants with their equivalents in BrokeredServicesUtility .
There was a problem hiding this comment.
More of an integration test I guess.
I can do that. In the interest of time, I might do that in a future PR, but I'll see.
The builds seem to be failing for some reason.
| { | ||
| // It is very important that these names and versions are kept the same as the ones in NuGet.VisualStudio.Internal.Contracts.NuGetServices. | ||
| internal static const string NuGetSolutionServiceName = "NuGetSolutionService"; | ||
| internal static string NuGetSolutionServiceVersion = "1.0.0"; |
There was a problem hiding this comment.
Are these candidates for a constant to put in the Common project?
There was a problem hiding this comment.
They are only relevant for the service declaring assembly.
And we do not want the contracts assembly to have any additional NuGet dependencies.
So my thought is no, because no one else should care about these values.
donnie-msft
left a comment
There was a problem hiding this comment.
Just some suggestions/questions.
| private const string NuGetSolutionServiceName = "NuGetSolutionService"; | ||
| private const string NuGetSolutionServiceVersion = "1.0.0"; |
There was a problem hiding this comment.
suggestion: add a comment saying that if these are changed, then src/NuGet.Clients/NuGet.SolutionRestoreManager/BrokeredServicesUtility.cs should be updated too.
There was a problem hiding this comment.
@dominoFire recommended adding a test, would you prefer that over a comment?
Thoughts on adding the test in the first place? (might do a different PR, don't want to complicate things here).
There was a problem hiding this comment.
A comment or a test (or both) is fine in another PR, as long as we have something to remember us to sync these values.
…sUtility.cs Co-Authored-By: Fernando Aguilar <[email protected]>
Bug
Fixes: https://github.com/nuget/client.engineering/issues/253
Regression: Yes
Fix
Details:
The RestoreManagerPackage is loaded on solution load/solution build and when it registers the by calling
InitializeAsynchttps://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.SolutionRestoreManager/RestoreManagerPackage.cs#L41This leads to loading the contracts assembly because of referring to NuGetServices.NuGetSolutionService which triggers the load.
Testing/Validation
Tests Added: No
Reason for not adding tests: We don't have any tests that will capture this.
Validation: Manual, inspected that the assembly is not loaded.