Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Conversation

@shana
Copy link
Contributor

@shana shana commented Apr 28, 2016

Fixes #267

For some reason, the xaml loader fails miserably when trying to resolve where to load our DLLs from if they're not yet in the process. The directories it's scanning don't include the extension installation path,
so it can't find any assemblies that are referenced directly from xaml (using types from other assemblies in code works fine, using them in xaml doesn't).

The way to repro bug #267 is to set Solution Explorer as the focused pane and then restart VS, so that the next time it starts up it doesn't load Team Explorer by default (which means our assemblies won't get loaded beyond just the package initialization). Then go to Tools / Options and try to load the GitHub property page. It fails miserably.

We have an assembly resolver code path as part of our ResourceDictionary implementation (SharedDictionaryManager), so every xaml user control needs to have at least one include that uses SharedDictionaryManager in order to trigger the assembly resolver hook up and ensure that libraries
are found.

I just moved the styles declarations to a separate file so that we have a good reason to use the SharedDictionaryManager here.

This feels like a weird VS bug, probably a good idea to do a small repro for Microsoft.

Fixes #267

For some reason, the xaml loader fails miserably when trying to resolve
where to load our DLLs from if they're not yet in the process. The
directories it's scanning don't include the extension installation path,
so it can't find any assemblies that are referenced directly from xaml
(using types from other assemblies in code works fine, using them in
xaml doesn't).
We have an assembly resolver code path as part of our ResourceDictionary
implementation (SharedDictionaryManager), so every xaml user control
needs to have at least one include that uses SharedDictionaryManager in
order to trigger the assembly resolver hook up and ensure that libraries
are found.
@shana
Copy link
Contributor Author

shana commented Apr 28, 2016

@haacked @grokys @paladique for 👀 and perhaps a commiserating chuckle at the weird bugs we get.

@grokys
Copy link
Contributor

grokys commented Apr 28, 2016

Could adding the assembly resolution to a base class of UserControl make this a little more discoverable? Or does the XAML designer not handle subclasses of UserControl properly still? I've not tried it for a long time...

@shana
Copy link
Contributor Author

shana commented Apr 28, 2016

Could adding the assembly resolution to a base class of UserControl make this a little more discoverable?

Most of our user controls are subclasses, but not this one haha. But you know, maaaybe I should just add the resolver to the package entry point class instead, that one will always run. :P

Instead of relying on the xaml controls to include the class that hooks
up the resolver, just hook it up on package initialization so it always
runs.
Also, remove useless base package class, it's not really doing anything
useful.
@shana shana force-pushed the fixes/267-property-page-not-loading branch from 567105c to 7a88701 Compare April 28, 2016 18:51
@shana
Copy link
Contributor Author

shana commented Apr 28, 2016

There, this will make sure the resolver is always hooked up.

@haacked
Copy link
Contributor

haacked commented Apr 28, 2016

This feels like a weird VS bug, probably a good idea to do a small repro for Microsoft.

Yeah, let's get our friends over there to look at it. Perhaps start with @acangialosi and @artl93 to help us find the right person to look at it.

@shana shana changed the title Make sure our assembly resolver always runs Make sure our assembly resolver always run May 2, 2016
@shana shana mentioned this pull request May 5, 2016
@shana
Copy link
Contributor Author

shana commented May 5, 2016

@haacked I've created a separate issue for doing the repro of this bug. Is this good to merge? I think I want to do a release with this and some other bugfixes next week.

@haacked haacked merged commit ba5f661 into master May 6, 2016
@haacked haacked deleted the fixes/267-property-page-not-loading branch May 6, 2016 17:37
@haacked
Copy link
Contributor

haacked commented May 6, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Property page doesn't load

4 participants