Search code examples
c#.netjetbrains-iderider

Rider "extern alias" and "using" support


I have some kind of a References DLL that contains references etc for, for instance, Newtonsoft.Json. I add it to project, use extern alias References and using References::Newtonsoft.Json, but Rider doesn't like it:

Screenshot from JetBrains Rider

P.S. It works absolutely fine in Visual Studio.


Solution

  • Update: this has been fixed as of version 2019.3

    If you're using an older version the workaround is to create a file in the root project folder called {solutionName}.sln.DotSettings with this data:

    <wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
    <s:String x:Key="/Default/Environment/Hierarchy/Build/BuildTool/MsBuildSolutionLoadingTargets/@EntryValue">ChangeAliasesOfStrongNameAssemblies</s:String></wpf:ResourceDictionary>
    

    As found here: https://youtrack.jetbrains.com/issue/RSRP-476048