Resharpening from the command line - resharper

I would like to use the ReSharper Adjust Namespaces feature on a number of solutions. I would like to automate this process by creating a command line application that uses the ReSharper API.
I looked at the ReSharper OpenAPI, but it seems to be geared towards using the ReSharper API from within an active Visual Studio session. I want to be able to use the ReSharper API from the command line.
Is this possible?

You are right: the open API is generally geared towards use within VS. While using it outside of VS is theoretically possible, it is technically challenging and may or may not work depending on your usage scenario.
There's no reason, however, why you shouldn't be able to adjust namespaces across several solutions right from within Visual Studio - of course, this would require to actually load each solution into the shell before performing manipulations. As things stand, this approach is your best bet.

Related

Does the ReSharper API expose ReSharper refactorings?

I'd like to know if the ReSharper API exposes the refactorings that come with the ReSharper plugin. So far I haven't been able to find anything on this in the docs or online. Basically I want to be able to execute several refactorings sequentially (almost like a script). I'm aware that the API allows you to create new refactorings, but I'm not sure if it allows for invoking refactorings that already exist in ReSharper.
Thanks in advance!

Recommend an IDE setup for CouchDB?

I tried experimenting with CouchDB but I find that without syntax highlighting, code completion, auto indenting, and other basic IDE features, I can't even code a Hello World.
What's the most common IDE set up, preferably integrated with eclipse?
Apache CouchDB is made up of simple components: HTTP and JSON. There are plugins for Eclipse for both of these. The largest "helper" tool you'll benefit from having is a "couchapp" publishing tool.
The "couchapp" tools take a file system directory and serialize it into a JSON "design document" for Apache CouchDB (or Cloudant) databases to use for MapReduce, _show, _list, validate_doc_update, rewrites, etc.
The best one available at this time is erica: https://github.com/benoitc/erica
You can then build your design documents with any IDE or editor, and publish them from the command line using erica.
Hope that helps, Alex.
erica is a useful tool but it's not an IDE.
I finally settled on KanapesIDE as the closest thing to what I was looking for.
It is still very basic, a far cry from something like Eclipse, but good enough for quick experiments while learning CouchDB.

Automated Web Reference Switching in C# project with NAnt

Problem: I have a C# 4.0 project with web references in Visual Studio 2010. I have two sets of web references, but I do not want to use them simultaneously. I want to be able to automatically remove all my current ones, add all the new ones, and then do the equivalent of 'update web reference' on each of them. I'm having a difficult time even finding where to start.
After searching around, I've found NAnt, which looks like it may be able to accomplish what I'm after (with the wsdl command), but I'm in unfamiliar territory.
Question: Is NAnt the right tool for this job? Will I be wasting time if I learn to use it? Is there a simple solution that I'm just not seeing? I'm more just looking for some guidance than a hammered out solution.
If anyone's interested:
After doing more research, I think I'm going to use some combination of
MSBuild,
How to call MSBuild from C#,
and
How do I automatically update a web reference at build time?
I'll update this answer with my solution when I'm done.

Convert codeSnippet to Resharper Templates .Is there a utility for this?I

I love resharper it's fantastic. I wanted to post this in the resharper forum but for some reasons when creating an account it fails.Anyway back to my questions.
I have many codesnippets and I would like resharper to see them.Still today you are stuck apparently if you using resharper settings you cannot view them.
As anybody by anychance created an utility to convert them to resharper templates?
I dont know how to create live templates and even if I did i would have to create 100s of codesnippets manually which I am not going to do.
Any suggestions?
There's no such utility that I'm aware of although it shouldn't be too complicated to create one. I have created a feature request in ReSharper issue tracker to allow direct import of any VS snippets to live templates. Hoping it can be implemented one day.
It should be noted however that merely importing VS snippets to ReSharper templates is only a half of the story: VS snippets provide quite a poor choice of variables in templates whereas ReSharper exposes a rich set of macros which allow deploying templates in a more intelligent manner.

Migrate from VS2005 to VS 2010 directly

Our project is currently developed in C#2 , VS2005.
We were thinking of migrating to VS2008 and C#3.
Do you think it might be a better idea to move directly to VS2010 instead?
We do not plan to release the new version till the end of next year.
Is there any advantage in moving from vs05 to vs08 and then moving to vs10?
thanks!
Well this post implies you can, but certain features of certain projects might get broken:
When you upgrade certain solutions from VS2005 to VS2010, the solution explorer layout can become broken. Some files move up the filter hierarchy. In our large solution, a hundred or so files ended up in the root of solution explorer.
It only seems to affect solutions where the solution explorer filter nesting is more than one deep, the files are not compiled (like headers), and they're excluded from the build in some configs.
Though an answer indicates it was fixed:
We have verified that the header file now gets placed under subfolder rather than directly the header filter. The fix should be available in the next public release of VS2010 (Beta2).
To answer your other point. One advantage of going via VS 2008 is that you can make that migration now (assuming you don't want to risk beta software) and start using the features of C# 3 straight away.
Visual Studio 2010 Beta 2 comes with a "Go-Live" license, so if you are ok dealing with beta software, then why not? I have tried it at work myself, while the other developers continue on 2008, but I have to be careful with the project files, to not check in changes, etc.... I don't use it all the time, yet, because it's a memory hog, but other than that performance is a lot better.
There are also a lot of features that are worth the upgrade. The text editor is in WPF now and scales nicely with a ctrl-click and I find I use it a lot. There are a lot of new addins being built to integrate with the UI because the new framework for the code editor exposes a new addin model that is much easier to develop against.
Being able to split windows across multiple montiors in a more flexible way is great.
If you go for the "Ultimate" versions, there are a ton of new architecture and modeling tools and tools for exploring code. I love the ability to generate a sequence diagram from some method and use that while I am reading some unfamiliar code. Works great.
The list goes on really, I have barely scratched the surface, so yeah move on if you want to learn how to use the new stuff, and no one is stopping you, go for it.

Resources