text: Webinar true ReSharper ninja!
  Watch as Igal takes you behind the scenes of ReSharper and shows you how to use this knowledge in your own code, to get even more out of ReSharper. The intended audience is intermediate-to-advanced ReSharper users.
  We received a lot of questions during the webinar and we’d like to use this opportunity to include the most frequently questions, as well as those we didn’t have a chance to answer during the webinar.
  Q&A on Igal’s Visual Studio setup and ReSharper plugins that he uses
  Q: Where does that “number of references” annotation in Igal’s Visual Studio come from?
  A: It is called CodeLens. This feature is a part of Visual Studio 2013 Ultimate but is not included in any of Visual Studio’s lower-end editions. Addressing a related question, no, we’re not planning to replicate the functionality of CodeLens in ReSharper.
  Q: What ReSharper plugins does Igal use?
  A: He uses a whopping 14 of them! Here’s the full list:
  - Agent Mulder
  - Enhanced Tooltip
  - JetBox
  - Nancy Plugin for ReSharper
  - Preview Tab Behaviour
  - Go to Word
  - InternalsVisibleTo Helper for ReSharper
  - NuGet support for ReSharper (bundled plugin)
  - Postfix Templates
  - ReSpeller Pro
  - Live Template descriptions
  - xUnit.net unit test provider
  - Joar Øyen’s extensions for ReSharper
  - Locate File or Folder in Solution Explorer
  If you’re using ReSharper 8.0 or above, go to ReSharper | Extension Manager to install any of these plugins.
  Q: What was the tool that changed .var into a variable assignment?
  A: This cool plugin is called Postfix Templates. If you want to have it installed, go to ReSharper | Extension Manager | Online and search for postfix. If you’re ready to contribute, here’s the plugin’s github repo.
  Q&A on code annotations
  Q: Does using ReSharper’s code annotations have any performance impact?
  A: No. They are just attributes, thus they do not affect your compiled assembly’s performance. As for ReSharper performance, the attributes are cached and the analysis is run even without attributes, so there is no performance difference there.
  Q: What do I need to do exactly for importing the annotations?
  A: There are two options. First, you can paste the source code of JetBrains annotations into your project. To do that, go to ReSharper | Options | Code Annotations | Copy default implementation to clipboard. Paste that into a new file, and you’re done. The second option is to reference a library called JetBrains.Annotations.dll that you can take from ReSharper’s installation folder.
  Q: Can I have a single annotations file in the entire solution, or is Annotations.cs created for every assembly/project you create?
  A: You are free to put Annotations.cs in a shared assembly, as long as it’s referenced.
  Q: Do I need to ship the library containing annotations with my code?
  A: If you add annotations by referencing JetBrains.Annotations.dll, then yes, you’ll need to ship the dll with your application. If you add them as a source file, they are compiled in your assembly, and there are no extra references to ship.
  Q: What if a project uses ReSharper annotations, but another developer does not have ReSharper installed? Do these annotations work for them?
  A: No, the warnings and analysis are provided by ReSharper. The annotations essentially provide hints for ReSharper’s analysis. If you don’t have ReSharper installed, they are just attributes that no one uses.
  Q: Can I make ReSharper treat everything as [NotNull] by default so that and I can use [AllowNull] instead?
  A: You can change ReSharper’s default assumption by going to ReSharper | Options | Code Inspection | Settings and change the value of Assume entity value can be null. The default value is optimistic (assumed to be not null) but you can change it to pessimistic (assumed to be null).
  Q: Regards [Pure] can ReSharper not simply look at the method return type as not being void instead?
  A: No, because e.g.
  string.ToUpper() is a pure method. It returns a new string without changing any of the fields of the current string instance. Calling it without assigning to a variable is pointless. If we add [Pure], ReSharper will warn you that the return value is unused.
  For more information on using code annotations, see ReSharper online help and two prior blog posts: ReSharper NullReferenceException Analysis and Its Contracts and Contract Annotations in ReSharper 7.
  Join us Tuesday, February 25th for our next webinar, dotMemory 4: What’s Inside with Maarten Balliauw.
  9 Responses to Webinar Recording and Q&A: ReSharper Secrets with Igal Tabachnik
  Johann says:February 19, 2014
  Thanks for a very useful webinar. I finally get ReSharper Annotations.
  I would love to see more on other ReSharper bits!!
  Do you by any chance know why ASP.NET MVC Controller/Action references no longer “underline” for existing project, but if I create new ASP.NET MVC 5 project or works for that project. Can’t figure it out!
  Thanks,
  Johann
  Igal Tabachnik says:February 22, 2014
  Yeah, there was an issue with MVC5 – simply put, there were no annotations for it! ReSharper 8.2 EAP fixes that! If you can’t update, you can use this workaround in the mean time.
  Oh, and thank you! 🙂
  Dew Drop – February 19, 2014 (#1726) | Morning Dew says:February 19, 2014
  […] Webinar Recording and Q&A: ReSharper Secrets with Igal Tabachnik (Robert Demmer) […]
  Igor says:February 19, 2014
  when I added annotation to concrete implementation (class FileGenerator), then R# doesn’t show correct warning in next sample:
  object source = null;
  ITextFileGenerator generator = new FileGenerator();
  generator.GenerateTextFile(source, targetFile.FileName);
  and correct warning in next code
  object source = null;
  FileGeneratorgenerator = new FileGenerator();
  generator.GenerateTextFile(source, targetFile.FileName);
  citizenmatt says:February 19, 2014
  Hi Igor. What annotations and warnings do you mean? Do you have an example of how you’ve got them applied, and what you expect the outcome should be?
  Igor Zima says:February 20, 2014
  public interface IBase
  {
  void Do(object data);
  }
  public class Concrete: IBase
  {
  public void Do([NotNull] object data)
  {
  ...
  }
  }
  ...
  // no warning (like "parameter cannot be null")
  IBase object1 = new Concrete();
  object1.Do(null);
  ...
  // warning (like "parameter cannot be null")
  Concrete object2 = new Concrete();
  object2.Do(null);
  Igal Tabachnik says:February 22, 2014
  Yes, this is because annotations are inherited, you need to decorate the interface itself, if you want them to be applied to derived types.
  Andrej Benedik says:March 12, 2014
  Is there an automatic way of creating the annotations for your code for CanBeNull, Pure and maybe some other annotation attribute? You at JetBrains surely did not create the annotations xml files by hand. You probably have a tool to do that.
  It would be great if this could be automatically generated with some command line tool – it would be even greater if this would be integrated into ReSharper and could be done in VS.
  The reason I would need that is that I have just learned about annotations and would love to use them. But have a lot of existing code and do not want to spend too much time to add the attributes to the existing code.
  End of Month Research Roundup – February 2014 | endjin blog says:March 31, 2014
  […] Webinar Recording and Q&A: ReSharper Secrets with Igal Tabachnik (Robert Demmer) […]