Problems upgrading plugins from ReSharper 8.2 to 9

I have tried upgrading my plugins by installeding the updated NuGet package 'JetBrains.ReSharper.SDK' to version 9.0.20141204.190166. But I end up with several errors resolving types that exist in multiple libraries that get referenced by the NuGet package 'JetBrains.ReSharper.SDK'.

Here are some of the errors:

Error 49 The type 'JetBrains.ActionManagement.ActionPresentation' exists in both 'c:\Program Files (x86)\JetBrains\ReSharper\v8.0\SDK\Bin\JetBrains.Platform.ReSharper.UI.dll' and '......\packages\JetBrains.Platform.Core.Shell.6.0.20141204.190142\DotFiles\JetBrains.Platform.UI.dll' 


Error 60 The type 'JetBrains.Application.DataContext.IDataContext' exists in both 'c:\Program Files (x86)\JetBrains\ReSharper\v8.0\SDK\Bin\JetBrains.Platform.ReSharper.Shell.dll' and ........\packages\JetBrains.Platform.Core.Shell.6.0.20141204.190142\DotFiles\JetBrains.Platform.Shell.dll'

Also I am using .NET for for my plugins. Is there a better .NET version to target for ReSharper 9 Plugins?

Also I have 3 projects in my solution that I add the NuGet package 'JetBrains.ReSharper.SDK' to, but I have notices the only the project I am currently having issues with is getting a ton more "References" added to it after updating NuGet package 'JetBrains.ReSharper.SDK'.

Please help.

4 comments
Comment actions Permalink

It sounds like that one project is referencing both SDK 8.0 and 9.0. I'd look at closing and reopening the solution - it's possible the project has been updated but that VS has not processed the changes correctly. If it still happens after reopening the project, remove all nuget references from the project, close and reopen again, just to be sure, and remove any other references that shouldn't be there. Then add the 9.0 SDK back in.

ReSharper plugins should be .net 4 assemblies.

More information can be found in the devguide - https://www.jetbrains.com/resharper/devguide/

Here are some useful pages for migrating to the 9.0 SDK - there are some important changes that will cause your plugin to not work if you miss them:


Regards
Matt

0
Comment actions Permalink

I have managed to updated most of my plugins, but I am still having some issues with a few parts that use WPF UI.

I have a settings WPF UI that's .cs looks like this:

[OptionsPage(Pid, "My settings", null, ParentId = EnvironmentPage.Pid, Sequence = 100, Internal = false)]
public partial class MySettingsUi : UserControl, IOptionsPage


And settings class:

[SettingsKey(typeof(Missing), "EggPack settings")]
public class EggPackSettings
{
    [SettingsEntry("", "Database connection string name 1")]
    public string ConnectionStringName1 { get; set; }

}

And the place the settings should show in the ReSharper options menu is there called "My settings", but no UI shows up any more when I click "My settings" to edit the settings.


Also I have an Action that opens/displays a WPF windows, but I get exceptions when the WPF control gets instanciated:

System.IO.FileNotFoundException was unhandled
  _HResult=-2147024894
  _message=Could not load file or assembly '....ReSharper...., Culture=neutral' or one of its dependencies. The system cannot find the file specified.
  HResult=-2147024894
  IsTransient=false
  Message=Could not load file or assembly '....ReSharper...., Culture=neutral' or one of its dependencies. The system cannot find the file specified.
  Source=mscorlib
  FileName=....ReSharper...., Culture=neutral
  FusionLog==== Pre-bind state information ===
LOG: DisplayName = ....ReSharper...., Culture=neutral
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: ....ReSharper...., Culture=neutral | Domain ID: 1
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio 12.0/Common7/IDE/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\John\AppData\Local\Microsoft\VisualStudio\12.0Plugins\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: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: The same bind was seen before, and was failed with hr = 0x80070002.

  StackTrace:
       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.Assembly.Load(AssemblyName assemblyRef)
       at System.Windows.Navigation.BaseUriHelper.GetLoadedAssembly(String assemblyName, String assemblyVersion, String assemblyKey)
       at MS.Internal.AppModel.ResourceContainer.GetResourceManagerWrapper(Uri uri, String& partName, Boolean& isContentFile)
       at MS.Internal.AppModel.ResourceContainer.GetPartCore(Uri uri)
       at System.IO.Packaging.Package.GetPartHelper(Uri partUri)
       at System.IO.Packaging.Package.GetPart(Uri partUri)
       at System.Windows.Application.GetResourceOrContentPart(Uri uri)
       at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
       at ....ReSharper.....Merged.NuGet.NuGetPackageManagerUi.InitializeComponent() in d:\...\Trunk\ResharperPlugins\...\NuGet\NuGetPackageManagerUi.xaml:line 1
       at ....ReSharper.....Merged.NuGet.NuGetPackageManagerUi..ctor() in d:\...\Trunk\ResharperPlugins\...\NuGet\NuGetPackageManagerUi.xaml.cs:line 15
  InnerException:
 
Also I dont know if it helps but, Had to use ILMERGE to get my plugin to work with R#9, since I have some dependency dlls.

0
Comment actions Permalink

There's not much to go on with this exception - it's saying that it's seen it before, and it failed, so this time it'll fail as well. It's failing with error 0x80070002, which means "file not found", so it can't find a .dll for some reason. I'd suggest enabling the fusion log viewer to save log files in a temp folder (start fusion log viewer as admin, change settings to "enable custom log path") and then re-run VS and try and get it to fail. You should get a log file that has more details about what it's looking for and where.

It's possible that ILMerge is causing issues, especially if WPF is trying to load resources from one of the .dlls you've merged.

You don't need to ILMerge things, though, you should be able to copy your dependencies to the installation folder, just like normal. Where you have to be careful is when the assembly is used by someone else, e.g. Newtonsoft.Json.dll.

0
Comment actions Permalink

Thanks for your help. It looks like ILMERGE was causing the issue with WPF windows/controls.

0

Please sign in to leave a comment.