Visual studio feeds

All Visual Studio blogs in one place

Subscribe

Enter your email address:

Delivered by FeedBurner

Increase your website traffic with Attracta.com

Google+

Contact

Email:
Subject:
Message:
Anti-spam: How many eyes has a typical person?

Follow us on FB

Search

C#/.NET Little Wonders: Interlocked Increment(), Decrement(), and Add()

AddThis Social Bookmark Button
Once again, in this series of posts I look at the parts of the .NET Framework that may seem trivial, but can help improve your code by making it easier to write and maintain. The index of all my past little wonders posts can be found here. Often times, we need to update a count in a multi-threaded program.  This may be an incrementing, decrementing, or adding a value in a thread-safe manner.  This post will discuss one of the lightest ways to do this: the Interlocked class. Problem: Increments Are Not Thread-Safe
The .NET Framework does a great job simplifying asynchronous programming to the point where you may be using threads with or without knowing it!  The Task Parallel Library (TPL), the new async keyword, and services (web, WCF, etc.) all use threading to accomplish concurrent execution.  The problem with asynchronous programming is that even though incrementing is very simple, it is not atomic. For example, if wanted to increment a count of trades in a system, we could do this:

Simple Scheduling in Windows Azure

AddThis Social Bookmark Button
Nate Totten recently wrote a nice post called Task Scheduling with Windows Azure Web Sites Using a Cron Job Service, in which he described how to use a third-party cron service to call your web application on a regular schedule. This is a great solution when your code can only run in response to an incoming web request, as is the case in Windows Azure Web Sites, Heroku, or any (other) shared hoster. Today, Google App Engine has a built-in mechanism like this, but I remember people advocating the third-party cron service approach on GAE before this feature
was added. The downside of this approach is that you've added a dependency on a third-party service. Nate wrote: When uptime is critical or you are running large processes I generally recommend using a Worker Role. It is pretty easy to setup a single worker role to run scheduled tasks. —Task Scheduling with Windows Azure Web Sites Using a Cron Job Service I too have recommended using a worker role (or a web role, really) for task scheduling, but I built a more complex solution, focusing on scaling out across multiple role instances and scheduling tasks at arbitrary times (preempting existing tasks)....(Read whole news on source site)

TFS Integration Tools – Issue: TFS WIT bypass-rule submission is enabled

AddThis Social Bookmark Button
Issue When you run the TFS Integration Platform for the first time with TFS WIT bypass-rule submission enabled you will likely get the following error: Figure: A Runtime Error Microsoft.TeamFoundation.Migration.Tfs2010WitAdapter.PermissionException: TFS WIT bypass-rule submission is enabled. However, the migration service account ‘MS Finance TFS Service Acct’ is not in the Service Accounts Group on [...]-Are you adopting Visual Studio, Team Foundation Serve or Agile? Are you stuck in a rut? Let us help you... email This e-mail address is being protected from spambots. You need JavaScript enabled to view it

Nightly news, 10 Aug 2012

AddThis Social Bookmark Button
LightSpeed Fix for an issue with LINQ providers handling of certain Any/All queries Added validation info to Mindscape.LightSpeed.MetaData, available on field information Fix for combination of cross join of two entities containing soft delete creating an invalid SQL statement Fix for column name not being specified when ClrCased for defining stored proc result entities Web [...]

Using BingMapsDirectionsTask In Windows Phone 7

AddThis Social Bookmark Button
Windows Phone has a number of great capabilities built into it for developers.  The Bing APIs allows you to easily give your application mapping functionality.  You may just want to give users directions to a fixed location.  What happens though when you want to give a user directions from their current location to an address that they are picking from application data?  This article will cover just that scenario. Since almost everything in Windows Phone development is asynchronous this can get a little tricky.  You end up creating an event handler for a GeoCoordinateWatcher and follow that with a
call to the Bing GeocodeService.  You end up with a chain of events where you are following the bouncing ball, but this is the sequence that I have found works.  Let’s take a closer look.  In my example I am using a ListBox that is data bound to a ViewModel.  I am using the selected item to index into the ViewModel’s collection to pull back the address information. First you are going to need to reference the System.Device namesapce. You will also need to add a service reference to the Bing GeocodeService. ...(Read whole news on source site)

GridView Custom Paging with LINQ

AddThis Social Bookmark Button
In this post we will take a  look at how to do pagination in GridView control. Paging is very helpful in presenting huge amount of data in the page because this helps speeding up the loading performance of the page and provides more friendly to end users in terms of data presentation.For this example, I’m going to highlight how to implement custom paging in GridView control using the power of LINQ and will show you some tips that would maximized the performance of the paged grid. For those who are not familiar with LINQ then here’s a short overview:
Language-Integrated Query (LINQ) is a set of features introduced in Visual Studio 2008 that extends powerful query capabilities to the language syntax of C# and Visual Basic. LINQ introduces standard, easily-learned patterns for querying and updating data, and the technology can be extended to support potentially any kind of data store. For more details please read here. To get started then let’s go ahead and fire up Visual Studio 2010 and then select new Web Application /WebSite project. Add a new page and then set up your page by adding a GridView and a Repeater control. The HTML...(Read whole news on source site)

Daily Windows Phone Development News 9 Aug 2012

AddThis Social Bookmark Button

Home