Showing posts with label ReSharper. Show all posts
Showing posts with label ReSharper. Show all posts

Tuesday, 7 October 2014

How to improve your ReSharper proficiency

Many developers that start working with ReSharper realize that the learning curve is steep. There are many hidden features, many shortcuts that need to be memorized, there are many tricks that one can do in order to improve his/her productivity. So here is what I did to help my colleagues to help them learn ReSharper.

I created a REST API that returns random ReSharper tips or trick. Its source code is available on github:

https://github.com/borismod/ReSharperTnT

I used AppHarbor for continuous integration and cloud hosting. So at the end, the REST API is available at the following URL:

http://resharpertnt.apphb.com/api/tipsandtricks/

It returns random ReSharper tip or trick in JSON format:









Then I incorporated the above REST API in our command-line build process:







So every time we build, we see random ReSharper tip or trick.

Enjoy coding!

Tuesday, 27 August 2013

Resharper's extract interface moves class property attributes to the interface

When I use ReSharper's magnificent feature of extract interface (Refactor -> Extract Interface), I have mixed feelings. On one hand I am happy that it saved me a lot of dirty work of manual cop-pasting the attributes, methods etc. On the other hand I am frustrated why class's attributes are copied to the interface. What the interface has to do with WCF attribute DataContract or Data Annotation attributes? I would expect ReSharper at least has an option whether to extract with or without the attributes. Apparently there is an open issue on TeamCity youTrack. The issue was open 7 (seven!!!) years ago and has only 3 votes (including myself).
Up vote for the issue: 


Tuesday, 20 August 2013

How to install a development machine for .NET development

Recently I had to install a development machine from scratch. Like many developers I hate doing things twice, thus I summarized my experience in a few lines of command-line script. The script is divided to three logical parts:

  1. .NET Development environment
  2. Repositories
  3. Database

Let me introduce Chocolatey: the magical command-line installer that made my life much easier since I was introduced to it. You need to install it once by pasting  the magical piece of code to command-line console:
C:\>@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin - See more at: http://chocolatey.org/#sthash.6Kd97faR.dpuf

.NET Development contains 
  1. VS2012 Professional. From my experience Professional edition is good enough for most of the development tasks. The Express edition is not supported by Resharper, so it is not acceptable for me. 
  2. Resharper - needless to explain its importance here.
  3. Nuget Package Manager - same
  4. Resharper Nuget plugin - a very nice plugin for Resharper, that significantly made my life easier: when I type a class ,which is not referenced in my project, the plugin looks whether a corresponding package is already referenced is adds reference to that package (instead of adding reference to bin\Debug\some_package.dll )
cinst VisualStudio2012Professional
cinst resharper
cinst NugetPackageManager
cinst resharper-nuget

Repositories:
These command-line lines install Tortoise SVN and VisualSVN.
cinst tortoisesvn
cinst visualsvn

Database:
You may choose any database, I chosen MySql for the small project I am working on. These lines of code would install MySQL server. Please note that root has empty password after the installation. It would also install a free SQL Client tool: HeidiSQL
cinst mysql
cinst HeidiSQL


P.S. A few last words about licensing. I do not encourage anyone working with illegal software, the opposite. All the above programs, except Visual Studio and Resharper, are free. They were especially chosen for the small development projects and are free of charge. Visual Studio license can be acquired by applying to BizSpark program of Microsft, for more details . Resharper license can be provided for free by JetBrains for open source projects.

Tuesday, 3 July 2012

How to avoid "is never used" ReSharper warning when class is used in IoC container?

Those of us who use ReSharper and some IoC container, must be familiar with the situation. You write a class, then register it in your container and everything works fine. However, ReSharper marks the class as "is never instantiated" or "is never used". Here a new plugin from Igal Tabachnik comes to our help. It's called Agent Multer and here a short video on how it works.

At the time of writing these lines, the plugin support Ninject, Windsor, Unity and Autofac containers. More details at: http://hmemcpy.github.com/AgentMulder/