Today MS announced the Windows Azure AppFabric.
http://www.microsoft.com/download/en/details.aspx?id=17691
Nandri(Thanks)
Sreenivasaragavan
Bytes Matters
Today MS announced the Windows Azure AppFabric.
http://www.microsoft.com/download/en/details.aspx?id=17691
Nandri(Thanks)
Sreenivasaragavan
IF you want to try out Microsoft Windows Azure Application Development
http://windowsazurepass.com/?campid=56742C47-F0FB-DF11-B2EA-001F29C6FB82
Nandri(Thanks)
Sreenivasaragavan
This is really cool Extension for VS.NET 2010 with SP1, when it hits breakpoint Debugger canvas shows just the methods that you are debugging with call lines and local variables as shown below.
Here below image I invoked two methods from different class so it opens different windows for each method with Local variables.
Here the following images shows the method and its Local Variables .
Here is the different options we can set for Debugger canvas, to get here click debug-> Options & Settings from VS.NET 2010 Menu.
FYI. The Debugger Canvas is built on technologies that only ship with Visual Studio Ultimate, such as IntelliTrace and the code analysis features in the Architecture tools.
Nandri(Thanks)
SreenivasaRagavan,
Today One of my Best Friend asked me how to host WCF service in IIS with HTTPS binding . I showed the demo to him from my machine then I thought let me share in my blog here it is.
To host WCF service in HTTPS here are basic steps we need to follow
1) First Create Self contained Certificate ( we are doing in Development )
2) Create Web Site with Port 443 ( Https –secure )
3) Change the some settings in Web.config
First to create Self contained Server Certificate Open IIS Manger and select the Server Certificates Icon Under IIS section as shown below
Next Create the Web site with HTTPS binding and 443 port number
Next we need to change web.config to set Security mode as Transport
Now browse the site with HTTPS
For Production environment you can obtain the Certificates from Verisign or CA and install on the server .
Nandri(Thanks)
Sreenivasa ragavan.
In this Blog post we are going to see Entity Framework 4.1 Code First approach. Here I am going to create Small console application to demonstrate. First of all you may ask question what is code first?
EF code first means first Define the classes this is nothing but our MODEL , then EF will work with theses classes this is called CODE FIRST APPROACH. Here I am going to use Nuget to get EF 4.1 Reference assemblies from the Internet. Here is how you get it.
First Create C# Console application then go to tools menu in VS.NET 2010
Once you click Package Manager Console you will provided to execute the Windows PowerShell prompt to execute the command . The command we need to execute to get EF 4.0 assemblies is
Install-Package EntityFramework.
Next create the Entity class and Context class as shown below
public class ContactCtx :DbContext
{
public DbSet<Contact> Contacts
{
get;
set;
}
}
public class Contact
{
public int Id
{
get;
set;
}
public string Name
{
get;
set;
}
public string Phone
{
get;
set;
}
public string Email
{
get;
set;
}
}
Here I am creating a contact that will be saved in DB.
class Program
{
static void Main(string[] args)
{
ContactCtx db = new ContactCtx();
db.Contacts.Add(new Contact
{
Name = "Vasanth.v",
Phone = "23232323",
Email = "v@v.com"
});
int a= db.SaveChanges();
Console.WriteLine("DB ID is " +a);
Contact c= db.Contacts.Find(1);
}
}
when you execute the program the DB is created and the records are added . EF use SQL Express by default if do not specify .
Nandri(Thanks)
SreenivasaRagavan
Here is the Calculator for windows Azure Pricing.
Nandri(Thanks)
SreenivasaRagavan
OData – Open Protocol Data aka WCF Data Services.
We all know that using EF(Entity Framework) Data model exposing any relational Data source is very very easy. But here I am going to show how to expose Plain Old CLR Objects as OData Service.
1) First Create Empty ASP.NET Web Application.
2) Second we need define or create the Entity Classes and we need to define Primary key using DataServiceKey Attribute for each entity as shown below
3) Next we need to create the class which exposes the IQueryable properties which returns the collection of Each entity which we created about. here I have defined the Entity as Contact so my IQueryable properties returns collection of Contacts.
Next we need to add WCF Data Service Template to this project to host the OData Service with the above Entities.
Once we added WCF Data Service Template next we need to specify the Entity class name as shown below. Next we can set the Access rule for Entity
here I set all Entity have read only access.
Now run the service you will see the ODataservice with Two Entity exposed .
IF we browse the following URL we get Contacts details http://localhost:52200/WcfDataService1.svc/MyContacts
Nandri(Thanks)
SreenivasaRagavan
Silverlight 5 continues the pace of rapid innovation, building on Silverlight 4's capabilities in the areas of rich applications and premium media experiences. With over 40 new features, the Silverlight 5 beta highlights dramatic video quality and performance improvements, as well as new capabilities that improve developer productivity
Here is the URL where you can download Silverlight 5.0 beta http://www.silverlight.net/getstarted/silverlight-5-beta/
Nandri(Thanks)
Sreenivasaragavan.R
Today there was need for me to print {} char in my console output. I knew there are standard Escape Sequences in C# but I was not aware of Escape Sequence for {. when I was binging I found the solution to this problem I just wanted to share with my Blog readers.
Nandri(Thanks)
Sreenivasaragavan.
In this Blog Post we are going to see how we can use this API in .NET Applications.
Here I am going create my own CacheLib class with the following Add, Get, Remove methods as shown above.
First Let me create a C# class file called CacheLib.cs in which I am going to implement all the CURD methods for the Cache object. to do let us create ObjectCache Cache = MemoryCache.Default . (Memory Cache) Then we Add Get, Add, Remove Methods.
Here I am created the Generic Add method.
User Defined class to store in Cache.
the following Code snippet shows how to add and retrieve data from Cache object .
Nandri(Thanks)
Sreenivasa Ragavan
Today I happened to come across System.Runtime.Caching new API in .NET Framework 4.0 this System.Runtime.Caching namespace contains types that let you implement caching in NET Framework applications. The good thing about this API is we can use this API same as ASP.NET Out Caching functionality but without a dependency on the System.Web assembly.
When I Reference System.Runtime.Caching assembly in my project it was showing not available then after looking project properties I found out this Namespace NOT part of the .NET 4 client profile, it is only in the full .NET 4 Framework. then I changed my project to Full .NET Framework as shown below.
Next Post we will see how we can use this API to Cache.
Nandri(Thanks)
Sreenivasaragavan
Point your Old browser to the following URL and see More Beautiful WEB – We Exchange Bytes
http://windows.microsoft.com/en-US/internet-explorer/downloads/ie-9/worldwide-languages
Nandri(Thanks)
SreenivasaRagavan
In Silverlight Application using App.Current.Host.Content IsFullScreen property we can go Full Screen mode.
First get the App.Current.Host.Content value and change to True if IsFullScreen is False.
when you click Full Screen Button here is the button click event handler code.
Here is the FullScreenChanged Event Handler.
Nandri(Thanks)
SreenivasaRagavan
MS Released SP-1 for VS.NET 2010.
I downloaded and Installed it went without any ERROR.
Nandri(Thanks)
Sreenivasaragavan
This method lives inside System.Diagnostics Namespace. This method Signals a breakpoint to an attached debugger.
This is really useful when we debugging .NET Windows Service. In your Program add the following line of code wherever you want to break into debug mode:
System.Diagnostics.Debugger.Break()
Nandri(Thanks)
Sreenivasaragavan
AggregateException which can contain one or more exceptions. Suppose when you have multiple threads of execution each of the threads could throw and exception as a result .NET Framework “bundle” all of these exceptions which occurred in the parallel operations into one exception which is passed (thrown) back to the caller. Acting as a container for all exceptions generated in a function is the function which the AggregateException Class performs.
To Understand any new concept its better to show in an action with Example.
Nandri(Thanks)
Sreenivasaragavan
Here are the steps to install Windows 7 Service pack 1. First you need to download System Update Readiness Tool for Windows 7 either 32 bit or b4bit based on what version of windows you installed on your Machine. Here is the link where you can download the above mentioned tool.
Nandri(Thanks)
Sreenivasa Ragavan
Basically Parallel.For and Parallel.ForEach is very similar to For and ForEach except that Paralle.For and ForEach use Multiple threads to execute different iterations of the loop body. Using Parallel loops are very good way to speed of the multicore machines.
when we execute the above code. here is the result .
Nandri(Thanks)
SreenivasaRagavan.
In this blog post we are going to see how we can covert asynchronous method call to Task by using Task.Factory.FromAsync method.
For this example I am going to call the following Web service to get the weather information for given Zip code.
when adding this above Web Service Reference we need to check Generate asynchronous Operations. so that VS.NET will generate Async method calls.
First Create Instance of the web service Proxy. and Create the Task with Begin and End methods which you are going to invoke on Web Service. Basically this web service takes input as Zip code and returns as 1 week Weather forecast info .
Here is the weather result for the Zipcode =75023
suppose Web service response is null then I can canceling the task . here is the result for unknown zip code.
Here I am scheduling a continuation task once we get the response from Web Service. I feel this way of calling Web Service is more convenient than an IAsyncResult.
Nandri(Thanks)
SreenivasaRagavan.