Open jmarolf opened 7 years ago
If you put a pause of 10 seconds before you attempt to add the reference, does it work?
@davkean it does, seems we need to way to wait for all the Framework references to be discovered.
@jmarolf I believe this is because we have async project tree load turned on, this is supposed to turn off so that the behavior is similar the legacy project system, I've filed: https://github.com/dotnet/roslyn-project-system/issues/1827 to track this. I'll leave this open just for verification when I turn async load off.
We looked at this async project load is not the cause.
Until this is fixed is there a recommended work around - an event to listen for that would indicated that vsproject.References has been populated?
net461
like so:Expected: the
WindowsBase
reference is resolved and added to the project.Actual:
Notes: This scenario works in the Reference Manager because we appear to populate the Framework references asynchronously on demand.
If the Framework references are populated by the Reference Manager first, subsequent calls to
vsproject.References.Add(assemblyName)
will succeed in finding the framework reference. It seems we need to add some logic ensure that this code path also causes the Framework references to be populated.This is blocking integration tests.