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

Using mdXaml in VSIX extension #36

Open
cpgames opened this issue Jul 8, 2022 · 4 comments
Open

Using mdXaml in VSIX extension #36

cpgames opened this issue Jul 8, 2022 · 4 comments

Comments

@cpgames
Copy link

cpgames commented Jul 8, 2022

I've been trying to get it working for several days so not sure if this is possible. When running VS instance I get an error:
FileNotFoundException: Could not load file or assembly 'MdXaml, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
I am guessing one of the dependencies from nuget packages is not automatically installed in vsix folder, but I am struggling to find which ones.

@whistyun
Copy link
Owner

I tried to create a VSIX extension with MdXaml. And it seems to work.

Can I look your project?




.

@cpgames
Copy link
Author

cpgames commented Jul 26, 2022

Sorry for late update, my project is https://github.com/cpgames/RefactorGraph I've had to explicitly include MdXaml.dll and ICSharpCode.AvalonEdit.dll to my project with a 'copy to output directory' flag set to get this working. It seems to work, but it would be nice if it could get the NuGet package to download automatically.

@whistyun
Copy link
Owner

whistyun commented Aug 1, 2022

I have used VS 2022 Community, which is added visual studio extension development toolset, in freshly installed windows 10.
I have tried building and running your project without the DLL copy settings and it seems to work. NuGet download MdXaml and AvalonEdit automatically, and both dlls are copied to the bin directory at build time.

I don't know what's going on, but it looks like something may be wrong with your visual studio.

@adospace
Copy link

adospace commented Mar 3, 2023

Hi, seems that if only use the control from XAML it throws an exception complaining that it can't find the DLL. I think your example works because you actually create it in code.

I solved it in my case by just creating a fake new viewer just before the InitializeComponent():

var _ = new MdXaml.MarkdownScrollViewer();

InitializeComponent();

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

No branches or pull requests

3 participants