Invoke or Run IIS Express x64 with VS2012.

For some reasons, you may have to run IIS Express x64 from VS2012. For later versions, it is automatically instantiated, however in case of VS2012, it isn’t. And there is no way Microsoft provides any patch or upgrade.

Although there is untestable hack or trick which did work for me.

You have to modify registry to invoke or run IIS Express x64.

Create batch file (*.bat) and put below code.

reg add HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\WebProjects /v Use64BitIISExpress /t REG_DWORD /d 1

Advertisements

Parallel Programming in .Net 4

Please note: If you are not aware of Parallel Programming, this article is for you else read it for your revision.

Every developer had come across performances issues and lots of brainstorming goes on when customer is not happy with the app performance.

Traditionally, we Improve application performance by – Remove scope of bad-coding, increase application productivity, writing efficient code, improve and optimize SELECT queries, and what not we do to increase and improve application performances, but we tend to forgot that hardware has certain limitation too. Like a single core (processor aka CPU) will execute single thread a time … logical enough. Right? Then comes Asynchronous process into picture, but again with its limitation – defining locks and releasing those, is again a tedious task, and if any is missed, your application will tend to crash. Oh! Did I pointed you can have Async process in ASP.Net to scale your applications and improve performances to certain limit. But this is not parallel programming, its multi-threaded programming.

Parallel vs. Concurrent

Concurrent is accessing the same resources or sharing resources for different problems. old skool example – 2 users accessing same table and even more worse accessing same row. thus increase chance of dead locks.

Parallel is dividing a certain task into a set of related tasks to be executed concurrently. latest example, update tweets/post on twitter.com/facebook using its API to your followers/friends! (Social Media everyone loves it and share latest updates!)

Context of Parallel programming:

Multi-core machines and think of utilizing their power.

Partioning, dividing single piece of work into multiple pieces to execute concurrently.

Staic partitioning, dynamic partitioning, thread pooling.

Model of .Net Parallel Programming:

Task Parallel Library – Task based programming consists of Task Class, Parallel Class, Parallel LIN!(PLINQ).

Architecture:

Example:

Serial Task:

for (int i, i <= 100, i++)

{

//Post Wall on Facebook

}

Asynchronous Task:

thread A = addressOf(SendPosts);

thread B = addressOf(SendPosts);

A.execute(); B.execute();

void SendPosts()

{

for (int i, i <= 100, i++)

{

lock (object);

PostIt(“happy friendship day!”);

unlock(object);

}

}

void PostIt (Account facebook)

{

//Post Wall on Facebook

}

Parallel Task:

System.Threading.Tasks.Parallel.For(0, 10, i =>

{

//Post Wall on Facebook

}

);

By now, you know how to swim in ‘llel programing, its time to deep dive into its ocean. Make sure you are ready with the following kits:

Get’ started – http://msdn.microsoft.com/en-us/concurrency/ee847320.aspx

‘llel programming in .Net 4 – http://msdn.microsoft.com/en-us/library/dd460693.aspx

Blog ‘llel programming – http://blogs.msdn.com/b/pfxteam/

Thread programming in ASP.Net – http://msdn.microsoft.com/en-us/magazine/cc163463.aspx

‘llel patterns – http://parallelpatterns.codeplex.com/

.Net 4.5 is coming with lot of improvements as hardware world is changing with multi-core architecture and soon you will not find the machines with single core and 2 core will soon out-dated.

Try it on vLabs from Microsoft – https://cmg.vlabcenter.com/default.aspx?moduleid=cc0bc14f-b222-4c3b-b29b-7f729df2af08

It did work for me:

Unable to start debugging. The Silverlight managed debugging package isn’t installed

If you installed latest version of Silverlight (Silverlight 4), it may break the your current silverlight development environment. After in the Silverlight 4 installation, if you try to debug any Silverlight 3 project, you will get a message from Visual Studio 2008, saying “Unable to start debugging. The Silverlight managed debugging package isn’t installed.”

Unable to start debugging. The Silverlight managed debugging package isn't installed.
Unable to start debugging. The Silverlight managed debugging package isn’t installed.

To fix this error, install the Silverlight Developer Run time. You can get it from here : http://go.microsoft.com/fwlink/?LinkID=188039.

short circuiting operators in .net

The short-circuiting operators are conditional versions of the logical operators. They conditionally evaluate the second expression as follows:

  • x AndAlso y will always evaluate x and will evaluate y only if x is true. (VB)
  • x OrElse y will always evaluate x and will evaluate y only if x is false. (VB)
  • x && y will always evaluate x and will evaluate y only if x is true. (C#)
  • x || y will always evaluate x and will evaluate y only if x is false. (C#)

Microsoft Sharepoint – documents

Virtual Lab: http://go.microsoft.com/?linkid=9644896

this was sometime back webcast: http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032378826&Culture=en-US

and if you are looking for developer concepts:

How to have SendMessages to another application in C#

Read streamed XML using StringReader object

 

StringReader stream = new StringReader(sResponseXML);
XmlTextReader xmlReader;
xmlReader =
new XmlTextReader(stream);
DataSet ds = new DataSet();
ds.ReadXml(xmlReader);

%d bloggers like this: