Trouble Loading Custom Extension

52 views
Skip to first unread message

Chris R.

unread,
Nov 13, 2017, 9:02:49 AM11/13/17
to resharper-plugins
Hi,

I'm trying to build a custom extension for Resharper. I've been following the SDK documentation and I packaged the extension into a NuGet package file and installed it via the Extension Manager in Visual Studio. However, when trying to debug, I'm not seeing my dll loaded in the Modules tool window. Looking at the troubleshooting steps (https://www.jetbrains.com/help/resharper/sdk/Extensions/Troubleshooting.html), I checked the installer logs and there are no errors. Any ideas as to why it will not load?

Thanks,

Chris

Matt Ellis

unread,
Nov 13, 2017, 9:16:21 AM11/13/17
to resharper-plugins
It's hard to say without any more details, but a) does the extension display as installed when you go back to ReSharper's Extension Manager and b) does your extension include any zone markers? https://www.jetbrains.com/help/resharper/sdk/Platform/Zones/Usage.html#zone-markers

Regards
Matt

Chris R.

unread,
Nov 14, 2017, 12:45:15 PM11/14/17
to resharper-plugins
Yes, the extension appears in the Extension Manager with the option to uninstall. And yes, I created a zone marker. To provide some more info, the purpose of the extension is to try to override the default behavior of the functionality on the File Header Text tab that appears in the Options window. Basically, I would like to be able to have the file header copied into a .cs file "as-is", meaning without being placed inside a comment block or single region.

In the code below, I'm extending from the FileHeaderUtils class from the Jetbrains.ReSharper.Feature.Services.CSharp.CodeCleanup namespace. And I copied the implementation of zone marker that's used in the JetBrains.ReSharper.Feature.Services.CSharp namespace. I was thinking the marker I use would need to be the same as that one.

namespace Resharper.Extensions.FileHeader {
   
[ShellComponent]
   
public class CSharpFileHeaderUtils : FileHeaderUtils {
       
public CSharpFileHeaderUtils(ISettingsStore settingsStore, IFileHeaderInjections fileHeaderInjections, LiveTemplatesManager liveTemplatesManager)
           
: base(settingsStore, fileHeaderInjections, liveTemplatesManager) {
       
}

       
// ...
   
}
}

namespace Resharper.Extensions
{
   
[ZoneMarker]
   
public class ZoneMarker : IRequire<ILanguageCSharpZone>
   
{
   
}
}

The link you provided says all zones must be active in order for the component to be included. Is this something I need to do myself? If so, how? Or am I doing something else wrong?

Thanks,

Chris

Matt Ellis

unread,
Nov 20, 2017, 9:49:52 AM11/20/17
to resharper-plugins
That looks fine, to be honest. I'm not sure what's going wrong. Could you share the code at all? You can email it to me directly at matt....@jetbrains.com, if you'd prefer.

Regards
Matt

Chris R.

unread,
Jan 11, 2018, 2:41:45 PM1/11/18
to resharper-plugins
Hi Matt,

I tried emailing your jetbrains account a while ago, but I'm not sure it went through. So I looked into this some more and I think there might be an issue with my DLL not getting copied when building the project. I noticed a warning when building the project that says "No installed product test. Available installed products: ". "test" is the value I set for the HostFullIdentifier tag in my project file. According to the documentation, it says if you specify an invalid host identifier then it should display a list of valid ones, however, it doesn't seem to be displaying any. I have a checked version of Resharper 2017.1.2 installed. My project uses Resharper SDK version 2017.1.20170428.83402. Any help would be appreciated.

Thanks,

Chris

Matt Ellis

unread,
Jan 16, 2018, 9:30:05 AM1/16/18
to resharper-plugins
Hi Chris. I'm sorry, that's me being rubbish and missing things and then trying to blame the Christmas vacation for it 😊 

The build should list the valid host identifiers if an invalid one is specified, but I haven't tested this in a while. But you can easily work out what the identifier should be by going to %LOCALAPPDATA%\JetBrains\Installations. The folders that look like "ReSharperPlatformVs12" can be used as host identifiers - this is for Visual Studio 12.0 aka 2013. Visual Studio 2017 has changed how things work, allowing for side-by-side installs, but you need to install ReSharper into each one separately. They will look something like "ReSharperPlatformVs15_8effad18". You'll use the whole of that string.

If you see any folder ending with "_000" or "_001", strip this from the identifier. So "ReSharperPlatformVs12_001" would have a host identifier of "ReSharperPlatformVs12". This is a temporary folder required when ReSharper updates an install (e.g. when installing a plugin) but the contents of the original folder are locked because Visual Studio is still open.

Of course, you can also copy them manually and remove the HostFullIdentifier element, at the least this will allow for a clean build.

Regards
Matt

Chris R.

unread,
Jan 26, 2018, 1:56:57 PM1/26/18
to resharper-plugins
Hey Matt,

Unfortunately, there is no Installations folder in %localappdata%\JetBrains. I found an Installations folder in C:\Program Files (x86)\JetBrains that contains folders that are in the format you described. As a guess, I tried manually creating the Installations folder in %localappdata%\JetBrains and then copying the "ResharperPlatformVs15_blah" folder from C:\Program Files (x86)\JetBrains\Installations, but that didn't work.

Do you happen to know what creates that folder? Do I need to reinstall something?

Thanks,

Chris

Matthew Ellis

unread,
Feb 5, 2018, 1:32:29 PM2/5/18
to resharpe...@googlegroups.com
Ah! This is because you have an administrative install, and unfortunately, admin installs don't support plugins. The problem is that we currently require plugins to be installed to the same directory as the rest of the product assemblies, and when installing plugins, that would require admin privileges, and install plugins per-machine rather than per-user, and our config doesn't support this scenario. The default means of install is per-user, and plugins work correctly with this method. We're planning on finally getting this fixed in ReSharper 2018.1, but until then, the only way to get this to work is to uninstall ReSharper and re-install per-user (or use Toolbox to manage the install for you). You can see more at RSRP-448743.

Regards
Matt

--
You received this message because you are subscribed to the Google Groups "resharper-plugins" group.
To unsubscribe from this group and stop receiving emails from it, send an email to resharper-plug...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages