Sunday, October 28, 2012

WCF REST Service Application Template

I made WCF Service Application project template that makes it quite easy to start developing RESTful services using WCF.

I have hosted on visual studio gallery and it can be downloaded from extension manager or following location:

http://visualstudiogallery.msdn.microsoft.com/9910d4b1-7e8d-4837-8d69-12a322fca476

Sunday, October 21, 2012

Default Browser Changer

I made a visual studio extension that adds toolbar to Visual Studio IDE which enables switching your default browser really easier.

I have posted it to Visual Studio Gallery and it is available at following location -

http://visualstudiogallery.msdn.microsoft.com/233945ae-0b7b-47e7-9b02-c5a11798afb5

Saturday, August 25, 2012

Weekly digest #11

Using JSHint inside Visual Studio – the basics, Steven Sanderson: JSHint is great. It’s a linting tool for JavaScript: a simple tool that can very often spot your mistakes before you do. It can save you from a lot of tedious debugging, lets you refactor JavaScript code with greater confidence, and reduces the chances of you deploying broken code to your production server.

What's really new in ASP.NET MVC 4 (not much), Max Toro: Max Toro summarizes what has really changed in MVC 4. A very concise and to the point explanation.

Entities, Models, and Architecture, Chris Eargle: I read several programming articles a day to expose myself to other’s ideas and maybe find a gem or two. I share the articles I find interesting, but I don’t always agree with everything the author has written. One of these articles caused quite a bit of controversy when I posted it to my Facebook, probably because I have a lot of DBA friends and the title was Why I Avoid Stored Procedures (And You Should Too).

How integrate Facebook, Twitter, LinkedIn, Yahoo, Google and Microsoft Account with your ASP.NET MVC application, Ugo Lattanzi: In the past week, 15 august, Microsoft released an incredible number of cool stuff, starting from Windows 8 and ending to Visual Studio 2012 including the new ASP.NET Stack.

Inside the DLR - Invoking methods, Simon Cooper: So, we've looked at how a dynamic call is represented in a compiled assembly, and how the dynamic lookup is performed at runtime. The last piece of the puzzle is how the resolved method gets invoked, and that is the subject of this post.

An Introduction to ASP.NET Web API, Rick Strahl: Microsoft recently released ASP.NET MVC 4.0 and .NET 4.5 and along with it, the brand spanking new ASP.NET Web API. Web API is an exciting new addition to the ASP.NET stack that provides a new, well-designed HTTP framework for creating REST and AJAX APIs (API is Microsoft’s new jargon for a service, in case you’re wondering). Although Web API ships and installs with ASP.NET MVC 4, you can use Web API functionality in any ASP.NET project, including WebForms, WebPages and MVC or just a Web API by itself. And you can also self-host Web API in your own applications from Console, Desktop or Service applications.

About signing assemblies, GAC and friends, Ran Wahle: Recently I was asked by one of my colleagues to explain to a customer of his about signing assemblies, putting them into GAC etc. So I’ve  decided to put some terms in order, for you to understand what it’s all about.

Extra Information from OAuth/OpenId Provider, pranav rastogi: When you authenticate a user using the OAuth/OpenId providers, you can request for some extra information about the user if you have granted access for these providers to send this information.

Tuesday, August 21, 2012

Weekly digest #7, #8, #9 and #10

It has been very tough last month so i could not publish anything. Following is what’s been interesting in these four weeks in the .Net world.

How to migrate an existing ASP.NET Website Project to Windows Azure, zafarx: In this blog we will discuss how to migrate an existing ASP.NET Website project to Windows Azure.

Why TCP is evil and HTTP is king, Ayende @ Rahien: I got asked why RavenDB uses HTTP for transport, instead of TCP. Surely binary TCP would be more efficient to work with, right?

Rich JavaScript Applications – the Seven Frameworks (Throne of JS, 2012), Steven Sanderson: t’s no longer good enough to build web apps around full page loads and then “progressively enhance” them to behave more dynamically. Building apps which are fast, responsive and modern require you to completely rethink your approach.

Task<T> vs IObservable<T>: when to use what?, Flavien Charlon: The Task<T> class was integrated with the .NET Framework in .NET 4.0, as part of what is known as the Task Parallel Library. The main purpose of the TPL was to facilitate writing parallel code, making it easier to run code on multiple cores, for instance. That is why the class itself was called Task, it represented a piece of program you could run in parallel with other pieces of program. Task, however, is much more versatile than that. In .NET 4.5 (now RTM, and on MSDN next week), Task will be the primary actor for working with the new async/await language feature.

Where does ASP.NET Web API Fit?,  Rick Strahl: With the pending release of ASP.NET MVC 4 and the new ASP.NET Web API, there has been a lot of discussion of where the new Web API technology fits in the ASP.NET Web stack. There are a lot of choices to build HTTP based applications available now on the stack - we've come a long way from when WebForms and Http Handlers/Modules where the only real options. Today we have WebForms, MVC, ASP.NET Web Pages, ASP.NET AJAX, WCF REST and now Web API as well as the core ASP.NET runtime to choose to build HTTP content with.

Simple.Web and Nancy, MARKRENDLE: Several people have asked me what the difference is between Simple.Web and Nancy, so I’m going to try and outline it here, and share some more of my motivation for writing Simple.Web in the first place.

Properties in JavaScript: definition versus assignment, Dr. Axel Rauschmayer: Did you know that defining a property is not the same as assigning to it? This blog post explains the difference and its consequences. It has been triggered by an email from Allen Wirfs-Brock on the es-discuss mailing list.

Knockout.js pro tips – working with templates, Filip W.: Just like last time, when we discussed observable arrays, I wanted to share a few (hopefully) useful tips about working with templates in Knockout. This is not going to be a comprehensive look into templating with knockout – there are plenty of resources that cover that – but rather a collection of smaller pieces of advice that could make you life easier.

Performance Tips: System.Text.StringBuilder and String.Concat, Feng Yuan: Much has been written about the benefits of using StringBuilder over string concatenation. So much so that there seems to be overuse of StringBuilder class, causing performance issues again.

A Tool to Remove Source Control Bindings from Visual Studio Solutions and Projects, Saveen Reddy: Ever need to share your Visual Studio solution or projects with someone? You ZIP up a folder with your code and send it. If your project is under source control – one that is integrated with Visual Studio – you will likely hear from the recipient of your code. They will be complaining that the get weird warnings from Visual Studio when they load the solution and projects.

Reliable job scheduling with NServiceBus and Quartz.NET, Jimmy Bogard: One of the more interesting features of NServiceBus is the ability to schedule messages and send messages in the future. The default implementation works well for simple cases, where you have messages that need to be sent every X seconds. But for many of our scenarios, we are more calendar based.

Caching LINQ Results, Chris Eargle: Christopher Nolan’s recent films have earned him a place among the pantheon of geek heroes. The grittiness of his Batman films corrected the campiness of the previous series, and his movie Inception represents recursion with artistic flair that should make Douglas Hofstadter proud. However, before Nolan’s recent slate of successful films is another film with analogies in programming.

OData support in ASP.NET Web API, Alex D James: Earlier versions ASP.NET Web API included basic support for the OData, allowing you to use the OData Query Options $filter, $orderby, $top and $skip to shape the results of controller actions annotated with the [Queryable]attribute. This was very useful and worked across formats. That said true support for the OData format was rather limited.  In fact we barely scratched the surface of OData, for example there was no support for creates, updates, deletes, $metadata and code generation etc.

Using JSHint inside Visual Studio – the basics, Steven Sanderson: JSHint is great. It’s a linting tool for JavaScript: a simple tool that can very often spot your mistakes before you do. It can save you from a lot of tedious debugging, lets you refactor JavaScript code with greater confidence, and reduces the chances of you deploying broken code to your production server.

Monday, July 23, 2012

Weekly digest #6

Mutexes, Semaphores, Monitors, ReaderWriterLocks, AutoResetEvents & ManualResets oh my, Abhijeet Patel: Up until a few years ago, mainstream programming for the most part did not involve asynchrony and/or parallelism except for the most performance demanding applications. In the multi core world we live in today async and parallel programming have become common place. Libraries such as TPL which provide first class framework level support and keywords like async/await built on TPL provide language support for writing elegant asynchronous code. Win8 Metro style apps built on the WinRT programming model is inherently async to help keep Metro style UIs responsive and fluid. As easy as it might appear to write async programs using these new features we should not forget our roots and the primitive constructs in the .NET framwework that TPL uses behind the scenes. This post provides a quick primer on the synchronization primitives that exist in the framework and the use cases of ech of them.

.NET Memory Management Basics, Chris Farrell: .NET memory management is designed so that the programmer is freed from the chore of consciously having to allocate and dispose of memory resources. It is optimized to work best with the most common patters of usage. However, the more conscious you become of scalability and performance, the more useful an understanding of NET memory management becomes.

MODEL BINDING WITH ASP.NET 4.5 AND VISUAL STUDIO 2012, Jalpesh P. Vadgama: In earlier version of the asp.net we have to bind controls with data source control like SQL Data source, Entity Data Source, Linq Data Source if we want to bind our server controls declaratively. Some developers prefer to write whole data access logic and then bind the data source with databind method. Model binding is something similar to asp.net mvc binding.

Dependency Injection with ASP.NET Web API and Autofac, Ron Cain: In WebApi, we define the basic verbs of our API in a class derived from ApiController.  When an Http request is received, WebApi uses the request URL and the application’s routing tables to map the request to a specific public method in a specific ApiController class.  All parameters for that method are satisfied using normal model binding.  Those parameter values typically come from the URL or from the request body, but model binding allows them to come from almost anywhere.

Using the ASP.NET Web API UrlHelper, Ron Cain: This article describes how to use the UrlHelper class in WebApi to create URL’s that can be used to invoke ApiController methods.   This UrlHelper class uses the application’s route tables to compose the URL, avoiding the need to hard-code specific URL’s into the app.

Choosing an ORM strategy, Jimmy Bogard: One of the mistakes I see people make (and have made myself) is assuming that you must choose exactly one ORM strategy for an entire database/application/system. It’s simply not the case. You can (and should) tailor your ORM strategy to your use case, and make sure you’re picking the right tool (or feature of the tool) for the job.

Friday, July 13, 2012

Weekly digest #5

Targeting Multiple Platforms with Portable Code: Overview,Brandon Bray: In this post, we will look at how you can use Visual Studio to write portable class library assemblies that can run on multiple Microsoft platforms. You can create a portable class library that will run on Windows 8, Windows Phone, and Xbox 360 devices. This post provides an overview of portable class libraries, and will be followed by more in-depth posts on portable code.

Is recursion really bad, Li Chen: After my previous post about the stack space, it appears that there is perception from the feedback that recursion is bad and we should avoid deep recursion. After writing a compiler, I know that the modern computer and compiler are complex enough and one cannot automatically assume that a hand crafted code would out-perform the compiler optimization. The only way is to do some prototype to find out.

How important is HTML5 Off Line, JoeStagner: There are a collection of facilities that are available to developers using HTML5 that enable an HTML5 app to run when no connection to the internet is available.

Integrating Knockout, JSRender, and Tweeter bootstrap with MVC4, Slava Khristich: MVC framework definitely changed the way we write our web applications now with clear separations between presentation layer, data and logic.With HTML5/CSS3 and jQuery we can see significant shift to client site implementations.New libraries like JSRender and Knockout brought even more separations of concerns to client site code.In this short article I would like to show an example of how I implemented integration between MVC4, JSRender, and Knockout.

JavaScript Data Binding Frameworks, Dan Wahlin: Data binding is where it’s at now days when it comes to building client-centric Web applications. Developers experienced with desktop frameworks like WPF or web frameworks like ASP.NET, Silverlight, or others are used to being able to take model objects containing data and bind them to UI controls quickly and easily. When moving to client-side Web development the data binding story hasn’t been great since neither HTML nor JavaScript natively support data binding. This means that you have to write code to place data in a control and write code to extract it. Although it’s certainly feasible to do it from scratch (many of us have done it this way for years), it’s definitely tedious and not exactly the best solution when it comes to maintenance and re-use.

Friday, July 06, 2012

Weekly digest #4

There’s a new .Net Digital Magazine in town… DNC Magazine, Greg Duncan:After serving thousands of online tutorials, tips and tricks for .NET developers for the last 5 years, DotNetCurry (DNC) is proud to present a high quality technical digital magazine for .NET techies. 'DNC Magazine' is a Free, bimonthly digital publication bringing you the latest from the .NET world presented by Microsoft MVP's and industry veterans, with years of experience in software development. This month's edition features hot topics like MVC4, SignalR, Knockout.js, TDD, VS ALM, HTML5, Azure and Metro Applications amongst others. Not to mention, a freewheeling interview with Ayende Rahien, the man behind RavenDB.

INotifyPropertyChanged Implementation for VS2012,Kathleen Dollard: I told some folks at the East Tennessee .NET UG (ETNUG, which was adorably put on the reservation board at the after meeting bar as “Eatnug”) meeting in Knoxville that I would post info on a .NET 4.5 version of INotifyPropertyChanged that used CallerMemberName. I also said I wanted to reference other people rather than making up on my own because I’d rather post something already vetted.

Easy Scaling in XAML (WPF), Robert May: Ran into a problem that needed solving that was kind of fun.  I’m not a XAML guru, and I’m sure there are better solutions, but I thought I’d share mine.

Jazz Up Your C# Code, Charles Wiebe and John Hansen: Maintaining code with complex permissions tends to be difficult, because the code can be distributed across multiple classes. By embedding permissions directly on methods and properties within a class, code is reduced and maintainability is simplified.

Stored procedures DO NOT increase performance, Shivprasad koirala: I assume ☺ that you have clicked on this article / blog because you are an awesome fan of stored procedures (like me) and you cannot see these kind of loose statements. My sincere suggestion would be to read this article once, give a thought on experiments and then the comments sections are always there to throw bricks at me.

SQL SERVER – Retrieve SQL Server Installation Date Time, Pinal Dave: I have been asked this question a number of times and my answer always has been “Search online and you will find the answer.” Every single time someone follows my answer, he finds the accurate answer in just a few clicks. However, this question is getting very popular nowadays, so I decided to answer this question through a blog post.

Friday, June 29, 2012

Weekly digest #3

Safely Test a JavaScript Change Without Touching the Server–A Huge Time Sever,  Ed Hintz:The fastest bug fixes are the ones you can make and test right on the spot.  However, many times access to the web server in order to update JavaScript files is not possible, convenient, or is potentially dangerous (affects all users if your fix fails miserably).

Using controllers from an external assembly in ASP.NET Web API,  Filip W.: In general, in my day-to-day job, I am working with large enterprise web applications, where clean projects, noise reduction and test driven development are holy. Therefore I have always been a big fan of placing MVC controllers outside the actual web application project, in a separate class library (or libraries).

ASP.NET Web API vs. ASP.NET MVC “APIs”, Dave Ward: I’ve been receiving lots of emails asking my opinion about ASP.NET Web API lately. One of the most recent messages boiled them all down pretty well in its subject line:
ASP.NET Web API – Why is it so cool?

Single Page App Using Knockout and ASP.NET, Bangla Gopal Surya: In this article, I will discuss how to create a sample single page application using Knockout and ASP.NET. This app shows a list of users based on types like Users, Admin Users, Super Admin Users, and shows user details upon selection of a user.

Understanding a Simple Async Program, Alan Berman: The Async feature in Visual Studio 2012 RC makes it easy to invoke asynchronous methods. If you mark a method with or async modifier, you can use the await operator in the method. When control reaches an await expression in the async method, control returns to the caller, and progress in the method is suspended until the awaited task completes. When the task is complete, execution can resume in the method.

NaN and typeof, Kiro Risk: First, NaN is not a keyword (unlike true, false, null, etc..), it is a property of the global object. The value of NaN is the same as the value of Number.NaN.

Tips on Web Developing and Designing, AJ Banda: For three years, I have done a lot of web site application and most of them are corporate sites. So I thought of sharing some of the things I have learned from my work. Let's start by differentiating the term web designer and web developer. It should be clear that this two jobs are related to each other but not similar.

Saturday, June 23, 2012

Weekly digest #2

SignalR – Group Notifications, Dane-Garrin Balia: The aim of what we will be trying to accomplish in this tutorial is to create a sample Broadcast Notification System using SignalR where specific groups can receive "notifications" in real time, from an external application.

ExecutionContext vs SynchronizationContext, Stephen Toub: I’ve been asked a few times recently various questions about ExecutionContext and SynchronizationContext, for example what the differences are between them, what it means to “flow” them, and how they relate to the new async/await keywords in C# and Visual Basic.  I thought I’d try to tackle some of those questions here.

The Three Models of ASP.NET MVC Apps, Dino Esposito: When you use the standard project template for creating ASP.NET MVC 3 applications in Visual Studio 2010, the newly created project comes with a predefined folder named Models. The Models folder goes hand-in-hand with two other predefined folders called Views and Controllers. Models, Views, and Controllers form the triad of roles that underlie any application that conforms to the popular MVC (Model-View-Controller) design pattern.

C# 5.0 Async Tips and Tricks Part 1, Jérôme Laban: This article is a discussion about how C#5.0 async captures the executing context when running an async method, which allows to easily stay on the UI Thread to access UI elements, but can be problematic when running CPU-bound work. Off of the UI thread, an async method may jump from thread to thread, breaking thread context dependent code along with it.

IIS Best Practices, CenkIscan: For a very long time, I have been asked for a document on IIS best practices. There are some blogs/articles on the Internet but I could not find a complete one. Actually, the main problem here is that there can not be “best practices” for a web server. A web server is just a hosting platform for applications, and, each and every application has its own needs. Therefore, in many cases, you will not have one universal best practice.

A Gentle Reintroduction to the Reactive Extensions for JavaScript Part 1, Matthew Podwysocki: In the previous post, I briefly covered that yes, the Reactive Extensions for JavaScript is alive, with two releases to show for it.  Before going into the depths of what’s in the box for V1 and V2, I want to step back and cover some of the basics and why you might care about this library.  It’s great to talk about APIs and general capabilities, but let’s first cover asynchronous and event-based programming in JavaScript today.

Getting started with Lucene.NET–Searching, Ricci Gian Maria: In the previous part I’ve showed how easy is to create an index with lucene.net, but in this post I’ll start to explain how to search into it, first of all what I need is a more interesting example, so I decided to download a dump of stack overflow, and I’ve extracted the Posts.Xml file (10 GB of XML file), then I wrote this simple piece of text to create the lucene index.

The theory behind covariance and contravariance in C# 4, Tomáš Petříček: In C# 4.0, we can annotate generic type parameters with out and in annotations to specify whether they should behave covariantly or contravariantly. This is mainly useful when using already defined standard interfaces. Covariance means that you can use IEnumerable<string> in place where IEnumerable<object> is expected. Contravariance allows you to pass IComparable<object> as an argument of a method taking IComparable<string>.

Saturday, June 09, 2012

Weekly digest: 9 June, 2012

A gentle introduction to Backbone with jQuery, Rocky Jaiswal:Backbone is a great JavaScript framework, I am sure most developers would have heard about it. I spent some time learning Backbone and want to share the little I have learned so far.

Types of Duplication in Code, John Sonmez:One of the biggest reasons to refactor code is to eliminate duplication.  It is pretty easy to introduce duplication in our code either unintentionally or because we don’t know how to prevent or get rid of it.

AspectMap – Aspect Oriented Programming for Complete Beginners, Chris Surfleet:In computing, aspect-oriented programming (AOP) is a programming paradigm which aims to increase modularity by allowing the separation of cross-cutting concerns

ASP.NET for Mobile, One ASP.NET and Realtime ASP.NET with Signalr - Video of Scott Hanselman's talks in Russia:The English versions of my three talks (plus one open Q&A sesssion) are now all up for your viewing pleasure.

Differences Between NHibernate and Entity Framework, Ricardo Peres:NHibernate and Entity Framework are two of the most popular O/RM frameworks on the .NET world. Although they share some functionality, there are some aspects on which they are quite different. This post will describe this differences and will hopefully help you get started with the one you know less. Mind you, this is a personal selection of features to compare, it is by no way an exhaustive list.