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

Runs twice on WPF projects #82

Open
picrap opened this issue Nov 21, 2016 · 6 comments
Open

Runs twice on WPF projects #82

picrap opened this issue Nov 21, 2016 · 6 comments
Labels

Comments

@picrap
Copy link
Member

picrap commented Nov 21, 2016

On WPF projects, Mr. Advice is invoked twice. Is it good or not?
Something to do with MarkupCompilePass1/MarkupCompilePass2?

@TheXenocide
Copy link

Interesting. I'm gonna follow this to see what you find out :). Seems like this could be related to XAML compilation? I wonder if you can specify attributes in XAML (not counting the partial class parts, just kinda curious if there's something for it since nothing comes to mind). I suspect it will be fine to run Mr. Advice once after it's all done, but not sure if there's a better post-build target to integrate with

@picrap
Copy link
Member Author

picrap commented Nov 21, 2016

It may be not soon, because I have other priorities, which are moving to .NET Standard and then adding some "advice-reflection" (gathering dependencies of a method, dependencies being methods and fields).

@picrap
Copy link
Member Author

picrap commented Dec 2, 2016

Runs twice and sometimes crashes once:

Internal error: System.IO.FileNotFoundException: Could not load file or assembly 'MrAdvice, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c0e7e6eab6f293d8' or one of its dependencies.
File name: 'MrAdvice, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c0e7e6eab6f293d8'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at ArxOne.MrAdvice.MrAdviceStitcher.Process(AssemblyStitcherContext context)

@TheXenocide
Copy link

Does it crash after the build has been cleaned? It might be that it doesn't copy dependencies until the second build? I think the first pass is probably to build the BAML resources from XAML which I don't think requires dependencies to be copied right away

@picrap
Copy link
Member Author

picrap commented Dec 6, 2016

It used to crash sometimes, I've been working on it and did not see the bug lately. But this is a blurry fix 🤕

@TheXenocide
Copy link

WPF is weird 🙁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants