Visual Studio extension could not find a required assembly

醉酒当歌 提交于 2019-12-05 09:13:25

This is a workaround for this problem. I don't like it, but it works :)

The solution is force load the assembly from the source code, such that PresentationFramework won't have to seek for it during parsing of XAML file. For instance:

private static void LoadSystemWindowsInteractivity()
{
    // HACK: Force load System.Windows.Interactivity.dll from plugin's 
    // directory
    typeof(System.Windows.Interactivity.Behavior).ToString();
}

static MyEditorFactory()
{
    LoadSystemWindowsInteractivity();
}

I had same problem. Below solution works for me.

  1. Create a text file name as "MyDef.pkgdef"
  2. Change content to

[$RootKey$\BindingPaths{some_guid}]
"$PackageFolder$"=""

  1. Add an asset in .vsixmanifest file

<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="File" Path="MyDef.pkgdef" />

  1. Be sure referenced dll must be signed and "Copy Local" attribute must be true.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!