I'm trying to create a custom Connected Service plugin for Visual Studio. I have encountered a problem where not all referenced assemblies are being packaged up in the VSIX file which means at run time I get errors about loading assemblies. The strange thing is that some assemblies are being pulled in but others are not and I cannot work out what the difference is.
The error I am getting is:
=== Pre-bind state information === LOG: DisplayName = Newtonsoft.Json, Version=126.96.36.199, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed (Fully-specified) LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/ LOG: Initial PrivatePath = NULL Calling assembly : Flurl.Http, Version=188.8.131.52, Culture=neutral, PublicKeyToken=null. === LOG: This bind starts in LoadFrom load context. WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load(). LOG: Using application configuration file: C:\Users\rjc\AppData\Local\Microsoft\VisualStudio\15.0_fa79a415Exp\devenv.exe.config LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: The same bind was seen before, and was failed with hr = 0x80070002.
In this case Flurl.Http is a package reference (although I've also had the same issue with it as a non-package reference) that is dependent on the Flurl and Newtonsoft.Json packages. When I install the plugin, I can see Flurl.Http.dll and Flurl.dll in the install directory but there is no Newtonsoft.Json.dll. There are other cases of this too. For example I also reference the Microsoft.IdentityModel.Clients.ActiveDirectory and Microsoft.CodeAnalysis.CSharp packages and the only obviously related assembly that seems to get installed is Microsoft.IdentityModel.Clients.ActiveDirectory.dll.
I tried raising an issue at the Connected Services github repo but have had no reply in almost a month. I was curious if anyone else has encountered similar issues or might know what I am missing/doing wrong?
User contributions licensed under CC BY-SA 3.0