Improve Code Fix performance using correct CodeAction.Create overload

In my previous post I wrote about solution-wide Rename Code Fix using Roslyn, which is supposed to analyze method declarations and suggest a fix when method marked with async modifier does not have a name that ends with Async. The code I suggested works just fine, however there were some comments about improvements that can be made to make it work better. In this post I’m trying to address one of the suggestions, what results in seconds version of AsyncMethodNameAnalyzer and AsyncMethodNameFix.
Continue reading

My first “Diagnostic with Code Fix” using Roslyn API

I think everyone already knows that during //Build conference Anders Hejlsberg announced that Roslyn API (renamed to .NET Compiler Platform) is now an open source project (he actually clicked Public button live, on stage). It’s really a great news. But even though a lot of people think that main purpose of that move is to allow everyone to make his own version of C#, I don’t think that’s true. I think the main purpose of Roslyn project is still the same - to provide modern and open compiler infrastructure which will make extension development much easier, because extension code now knows exactly the same stuff compiler does. Because of that I decided to give it a try and write simple Diagnostic with Code Fix.
Continue reading

ASP.NET Identity 2.0.0 – UserName and Email separation

The release of new version of ASP.NET Identity – ASP.NET Identity 2.0.0 comes with new sample project, which shows how all the new features like email confirmation, password recovery and two-factor authentication can be used while creating web applications. However, the new sample follows an approach which sometime is not acceptable: it uses an email address as user name. In my case, I need these data to be separated, and that’s why I decided to modify sample project to allow that.
Continue reading

Folders in F# projects. How to do it? What to avoid?

I’ve been working on a new feature for Visual F# Power Tools extension, which would creating and maintaining folder structure within F# projects. I have to admit, it was not a pleasure to dig into VS SDK and try to get it working. The most annoying part: part of SDK related to Solution Explorer still uses COM interfaces… Second most annoying part: Solution Explorer complaining about completely correct project structure…

But anyway. The more I dig into it, the more weird behaviors I experienced. And because I don’t think I’m the only one struggling with folders in F# projects – there are couple questions on StackOverflow about this (like here and here) – and because there is also a known workaround how to force VS to show folders in your project – just manually edit .proj file – I decided to write about couple of problems you may run into trying to force F# project to contain folders.
Continue reading

Why contributing to an Open Source project is a good way to learn new language and/or technology

I’ve been trying to learn F# for quite a long time now, but there was never a good way to do it. First of all, I need some way to evaluate my work. It’s really easy to learn new language, but you never know if you’re using it right. That’s even more likely to happen when not only language is new but also general idea behind that language is much different. That’s the case with my F# learning. Almost every programming language I’ve used so far can be classified as object-oriented-first language. F# is different. It’s functional-first language and because of that it’s more about learning how functional programming looks like, not how F# syntax looks like. But I think I found a way to learn F# right. And the answer is: Open Source.
Continue reading

Learning F# and solving Digit Recognizer competition on kaggle

I’ve started learning F# couple weeks ago, but unfortunately after few days I got quite busy and after these days I still know almost exactly nothing about functional programming at all. That’s why I decided I have to look for some challenges and samples I could work on while learning. That’s how I found F# and Machine Learning Dojo slideshow and Digit Recognizer competition on kaggle. I decided to give it a try. Of course, the main goal is to learn F#, not to get 100% correctness in the competition. You should have it in mind while reading the post :)
Continue reading