Ahmadreza's Notes

On .NET Framework and Software Architecture

Quick Note: Memory Leak Or Missing Configuration

leave a comment »

Imagine you have multiple instances of SQL server on your server and one of them is using almost all of available memory and second one is facing memory shortage. What are possible Cause for this symptom. Does one of application have memory leak?

The answer is NO, When you install multiple instances of SQL server on a single server you have to consider memory allocation for each instances because windows does not balance memory across applications with the memory notification.

The first instance with a work load will  used huge portion of memory (Especially when you have actual data – not testing – on that instance).

Three approaches are available for Server Memory Option documented in the section “Sunning Multiple Instances of SQL server” and if you have selected third one which is “Do nothing”, you might have same problem.

  • Do nothing (not recommended). The first instances presented with a workload will tend to allocate all of memory. Idle instances or instances started later may end up running with only a minimal amount of memory available. SQL Server makes no attempt to balance memory usage across instances. All instances will, however, respond to Windows Memory Notification signals to adjust the size of their buffer pools. As of Windows Server 2003 SP1, Windows does not balance memory across applications with the Memory Notification API. It merely provides global feedback as to the availability of memory on the system.

Written by Ahmadreza Atighechi

November 14, 2011 at 5:24 pm

Posted in Blog

Tagged with

How to sign the XBAP with your own certificate

with 5 comments

I am writing a series of posts about WPF Browser Application, XBAP  and configuration tips. I’m going to host this application in IIS 5.1 and I developed them in .Net 3.5. The reason I have chosen IIS5.1 and .Net 3.5 is because of challenges I had in one of my recent projects. Configuring this type of projects is different in other versions of IIS and .Net frameworks and they are not is subject of this post series.

  1. How to create a simple Browser Enables WPF application
  2. How to host a windows form application inside XBAP
  3. How to sign the XBAP with your own certificate
Note: Making a browser enabled application as full trust according to this method is not completely secured. This can be used for testing purposes in testing environments. Please select proper certificates and known trusted root certification authorities.

Before starting I think its better to have same understanding of file extension that we are going to talk about.

.cer file: Apublic key which is given by Certificate Authority

.pvk file: This file is your private key and should keep it confidential

.pfx file: This is a Personal Information Exchange file and again you should keep it confidential because it contains

We have created a simple WPF Browser application and a simple windows application which is hosted inside the XBAP application. When we created WPF application Visual Studio automatically create a .pfx (Which is used for signing ClickOnce manifest).

To create your own certificate you need to follow these steps:

Step 1: Creating your key pairs (Public and Private)

open Visual Studio Command Prompt (2010) and then goto your application path and type following command


makecert -n "CN=Your Company Name" -r -sv Key.pvk Key.cer

A password dialog box will be displayed and you set your own password. This command creates two files one private key and one certificate.

Step2: Then you need to create PFX file which is used for signing ClickOnce manifest and contains both private and public key.


pvk2pfx.exe -pvk Key.pvk -spc Key.cer -pfx KeyPFX.pfx -po [password]

Put your own password as [password] and this command will create a PFX file

Step 3: Back to the solution explorer delete “SimpleBrowserApplication_TemporaryKey.pfx” and goto Application property page and select signing tab. Click on “Select from file” and select the PFX file you have just created.

Step 4: Just like before  publish it to you server.

Step 5: Give certificate to the client and register the certificate on the client machine. To do this double-clicking on .cer file. You will see following window. Click on Install Certificate button.

Follow installation wizard and click Next on the first window.

In this window select “Place all certificates in the following store”  and then select “Browse…” button.

In this window select “Trusted Publishers” and then click Ok. Select “Next” previous windows and then select finish.

Step 6: Redo the step 5 but this time select “Trusted Root Certification Authorities” as the certificate store.

Now you have enabled your client to accept this XBAP application as full-trust application.

Written by Ahmadreza Atighechi

May 20, 2011 at 9:30 am

Posted in Blog

Tagged with

How to host a windows form application inside XBAP

with 4 comments

I am writing a series of posts about WPF Browser Application, XBAP  and configuration tips. I’m going to host this application in IIS 5.1 and I developed them in .Net 3.5. The reason I have chosen IIS5.1 and .Net 3.5 is because of challenges I had in one of my recent projects. Configuring this type of projects is different in other versions of IIS and .Net frameworks and they are not is subject of this post series.

  1. How to create a simple Browser Enables WPF application
  2. How to host a windows form application inside XBAP
  3. How to sign the XBAP with your own certificate
Imagine we have an existing windows form application or you are developing a windows form application. The question is how you can make your windows application browser enabled. The answer is Browser Enabled WPF application. But usually when we create a WPF application we have to use WPF elements inside Xaml. “WindowsFormsIntegration” will help you to host your windows form application inside your WPF.
For rest of this post I consider you already have previous post sample, because I’m going to update the same project. Lets open the SimpleBrowserApplication and add a reference to ”WindowsFormsIntegration”. As the second step I want to add new project to our solution of type “Windows Form Application” and I call it “WinFormSample”.
Note: Make sure when you are creating windows form application you selected .Net 3.5 because we are going to reference this project inside WPF project and they should be compatible.
That is how our solution looks like after adding windows form application and couple of simple controls on it. Next step we have to reference WinFormSample in SimpleBrowser application. Now our WPF application has got two more references which are “WindowsFormsIntegrations” and “WinFormSample”. Now we have to change Page1.xaml and put the following StackPanel instead of previous <Grid>

<StackPanel x:Name="stackPanel">
</StackPanel>

Actually this is a place holder for WindowsFormsHost that we are going to place in main form. For next step we need add System.Windows.Froms reference to WBP project. Then  we have to change page1.xaml code as follow.

public partial class Page1 : Page
{
	private readonly Form1 mainForm = new Form1();
	WindowsFormsHost windowsFormsHost;

	public Page1()
	{
		InitializeComponent();
		AddWindowsForm();
	}
	private void AddWindowsForm()
	{
		windowsFormsHost = new WindowsFormsHost();

		stackPanel.Children.Add(windowsFormsHost);

		// If you don't write this line you'll get "The child control cannot be a top-level form" exception
		mainForm.TopLevel = false;
		windowsFormsHost.Child = mainForm;
	}

}

We created a WindowsFormHost and added this control into stackPanel Child list and set the child property of windowsFormsMost to mainForm which is already instantiated of Form1.

One of important thing is setting mainForm.TopLevel to false. Because if you don’t do that you will get an exception and if you dive into innerexeptions you will find out that main reason is System.ArgumentException: The child control cannot be a top-level form.

If you run this application you’ll see following browser window which hosts Form1.

The point is when you run this application from visual studio it runs in My Computer Zone so there is no problem for security. According Microsoft document “WPF Partial Trust Security” section “Partial Trust Programming” when you run WPF application which requires full trust and current zone is “My Computer” behavior is “Automatic full trust” and for getting full trust no action is required.

But if you publish this project and try to browse this application you will get Trust Not Granted error. Because application will request for full trust and it fails with “Trust Not Granted”. In order to get full trust is signing XBAP with certificate.

In the next post we will see how to sign XBAP with your own certificate and make it work.

The source code of this application is also available you can download it here

Written by Ahmadreza Atighechi

May 17, 2011 at 9:29 am

Posted in Blog

Tagged with

How to create a simple Browser Enabled WPF application

with one comment

I am writing a series of posts about WPF Browser Application, XBAP  and configuration tips. I’m going to host this application in IIS 5.1 and I developed them in .Net 3.5. The reason I have chosen IIS5.1 and .Net 3.5 is because of challenges I had in one of my recent projects. Configuring this type of projects is different in other versions of IIS and .Net frameworks and they are not is subject of this post series.

  1. How to create a simple Browser Enables WPF application
  2. How to host a windows form application inside XBAP
  3. How to sign the XBAP with your own certificate

Firstly run Visual Studio 2010 and select new project from file menu

To create simple WPF browser application you need to select “WPF Browser Application” template from project templates. Once project template is created open Page1.xaml Xaml code and change Grid into following code

    <Grid>
        <Rectangle
            Fill="#33CC66"
            Width="2in"       Height="1in"
            Canvas.Top="25"          Canvas.Left="50"
            StrokeThickness="6px" Stroke="Orange" />
    </Grid>

This Xaml code will create a simple rectangle with border and if you run this application, It will show following shape inside your browser.

Deploying a WPF application

There are multiple ways to do that. Simply you can publish your application using visual studio. Right-click on project and select publish menu. Publish wizard is displayed. Follow the steps until the end of publish steps.

You must follow Microsoft instruction for How to: Configure IIS 5.0 and IIS 6.0 to Deploy WPF Applications to configure your server and client requires Internet Explorer plus .Net Framework to run this application.

Basically internet application which runs inside the browsers should have restricted access to critical resources. It means WPF browser application -By default- should respect to these restrictions so that client can make sure there is no harm to execute this application. Browser Enabled application by default is marked as partially trusted and ClickOnce security setting is set to Internet Zone so that your application will be running on the client browser without any problem.

As you see “Enable ClickOnce security settings” and “This is a partial trust application” are ticked by default and and ClickOnce manifests is signed by a temporary key. Which means on one your application will be restricted to security permission which is fully described in this document. On the other hand your application will be executed on client browser without any other additional configuration.

Above picture shows that you can run This simple WPF Browser Enabled application in “Internet Zone”.

The main reason of writing this post series for me is hosting windows form application inside XBAP application and running inside browser. In next post we will see how to host an existing windows form application within a WPF Browser application.

Sample project is also available you can download it here

Written by Ahmadreza Atighechi

May 12, 2011 at 2:59 pm

Posted in Blog

Tagged with

HOW TO propagate WCF Impersonation to COM objects

with 16 comments

I was working on a project to write a wrapper on a COM component in WCF. The COM object needs impersonation in some levels to provide certain functionalities to impersonated user. Basically impersonation in .Net application doesn’t propagate COM calls. I’ve seen following sentence in How To: Use Impersonation and Delegation in ASP.NET 2.0

The impersonation token does not propagate across threads if you use COM interop with components that have incompatible threading models, or if you use unmanaged techniques to create new threads

Actually I have a COM component and I want to use this component in my WCF Services. One of classes in COM object has got a property which returns current user. I wrote a console application to test impersonation and see if impersonation does propagate to COM object or not. I wrote a class for impersonation and  it has a method called “ImpersonateUser” that impersonates to passed username and password.  Following code returns different username for .net and COM object. It means it doesn’t propagate to COM object.

static void Main(string[] args)
{
	DoWork();
	Console.ReadLine();
}

private static void DoWork()
{
	ImpersonateClass impersonate = new ImpersonateClass();
	using (impersonate.ImpersonateUser("AnotherUser",
					"Domain",
					"passw0rd"))
	{
		COMTESTLib.TestClass obj = new COMTESTLib.TestClass();
		Console.WriteLine(string.Format("COM:{0} .Net:{1}", obj.CurrentUserName,
			System.Security.Principal.WindowsIdentity.GetCurrent().Name));
	}
}
//Returns:COM:DOMAIN\CurrentUser .Net:DOMAIN\AnotherUser</pre>

But I used CoInitializeSecurity to initialize security with impersonation and cloaking. CoInitializeSecurity should be called before any marshalling so I called CoInitializeSecurity as first function call.

[DllImport("ole32.dll")]
public static extern int CoInitializeSecurity(IntPtr pVoid, int
cAuthSvc, IntPtr asAuthSvc, IntPtr pReserved1, RpcAuthnLevel level,
RpcImpLevel impers, IntPtr pAuthList, int dwCapabilities, IntPtr
pReserved3);

static void Main(string[] args)
{
	int result = CoInitializeSecurity(IntPtr.Zero, -1,
	IntPtr.Zero, IntPtr.Zero,
	RpcAuthnLevel.Connect, RpcImpLevel.Impersonate,
	IntPtr.Zero, Convert.ToInt32(EoAuthnCap.DynamicCloaking), IntPtr.Zero);

	DoWork();
	Console.ReadLine();
}

private static void DoWork()
{
	ImpersonateClass impersonate = new ImpersonateClass();
	using (impersonate.ImpersonateUser("AnotherUser",
					"domain",
					"passw0rd"))
	{
		COMTESTLib.TestClass obj = new COMTESTLib.TestClass();
		Console.WriteLine(string.Format("COM:{0} .Net:{1}", obj.CurrentUserName,
			System.Security.Principal.WindowsIdentity.GetCurrent().Name));
	}
}
//Returns:COM:DOMAIN\AnotherUser .Net:DOMAIN\AnotherUser</pre>

Somebody suggested using built-in impersonation method for WCF so I changed my service to following code by setting [OperationBehavior(Impersonation = ImpersonationOption.Required)] and some changes in Web.Congif to make it work.

[OperationBehavior(Impersonation = ImpersonationOption.Required)]
public string GetUserNames()
{
	return DoWork();
}

private string DoWork()
{
	string result;

	COMTESTLib.TestClass obj = new COMTESTLib.TestClass();
	result = string.Format("COM:{0} .Net:{1}", obj.CurrentUserName,
		System.Security.Principal.WindowsIdentity.GetCurrent().Name);

	return result;
}

I passed user credentials from client for impersonation.

static void Main(string[] args)
{
	ServiceReference.ServiceImpersonateClient client = new ServiceReference.ServiceImpersonateClient();
	client.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Delegation;
	client.ClientCredentials.Windows.ClientCredential.Domain = "Domain";
	client.ClientCredentials.Windows.ClientCredential.UserName = "AnotherUser";
	client.ClientCredentials.Windows.ClientCredential.Password = "Passw0rd";

	string str = client.GetUserNames();
	Console.WriteLine(str);
	Console.ReadLine();
	client.Close();
}
// Returns COM:DOMAIN\CurrentUser .Net:DOMAIN\AnotherUser

But it returns different usernames which means impersonation of WCF does not propagate to COM object.

Ok I posted this issue in WCF Forum and I’ve got a simple response but it gave me a good clue. Allen Chen (The moderator) suggested me to use self-hosting for WCF instead of IIS hosting.

Self-hosted WCF was great idea!  Actually it works on self-hosted. But my WCF service should be unattended so that I created a managed service for WCF hosting. To make it work I’ve created three projects. One WCF service library which is used in managed service application. And the third one is a console application for testing. I’ve called CoInitializeSecurity on constructor of my service class as following

private ServiceHost serviceHost;
 public WCFServiceHost()
 {
  int result = CoInitializeSecurity(IntPtr.Zero, -1,
  IntPtr.Zero, IntPtr.Zero,
  RpcAuthnLevel.Connect, RpcImpLevel.Impersonate,
  IntPtr.Zero, Convert.ToInt32(EoAuthnCap.DynamicCloaking), IntPtr.Zero);
  //EventLog.WriteEntry(result.ToString());
  InitializeComponent();
 }

 protected override void OnStart(string[] args)
 {
  if (serviceHost != null)
  {
  serviceHost.Close();
  }

  // Create a ServiceHost for the CalculatorService type and
  // provide the base address.
  serviceHost = new ServiceHost(typeof(ServiceImpersonate));

  // Open the ServiceHostBase to create listeners and start
  // listening for messages.

  serviceHost.Open();

 }

 protected override void OnStop()
 {
  if (serviceHost != null)
  {
  serviceHost.Close();
  serviceHost = null;
  }
 }

It doesn’t work with built in WCF impersonation. But I used my impersonation class inside the service class to impersonate to desired user and it works.

public string GetUserNames()
 {
  ImpersonateClass impersonate = new ImpersonateClass();

  using (impersonate.ImpersonateUser("AnotherUser",
         "Domain",
          "passw0rd"))
  {
   return DoWork();
  }
 }

 private string DoWork()
 {
  string result;

   COMTESTLib.TestClass obj = new COMTESTLib.TestClass();
   result = string.Format("COM:{0} .Net:{1}", obj.CurrentUserName,
       System.Security.Principal.WindowsIdentity.GetCurrent().Name);
  return result;
 }

In the console application I simply called my service like following code:

ServiceReference.ServiceImpersonateClient client = new ServiceReference.ServiceImpersonateClient();
  string str = client.GetUserNames();
  Console.WriteLine(str);
  client.Close();
  Console.ReadLine();
// Returns COM:DOMAIN\ AnotherUser .Net:DOMAIN\AnotherUser

When you host WCF in IIS the process is spawned by IIS and before your code running code managed by IIS will be run in the process, which is almost out of your control. CoInitializeSecurity thus might be called before you calling it.

Written by Ahmadreza Atighechi

September 16, 2010 at 5:19 pm

Posted in Blog

Tagged with , ,

Updating my using with Windows Live Writer

with one comment

I didn’t know about this sophisticated application so called “Windows Live Writer”. Actually quiet frequently I was looking for an HTML editor to write my blog post and then update my blog. Because HTML edit which comes with BlogEngine.Net is not easy to use – and its the same problem with all web based HTML editor-. To be honest windows live writer is something more than what I expected.

I was reading an article about AtomPub Using WCF Data, I came across Windows Live Writer which surprisingly supports BlogEngine.Net (Its better to say that BlogEnine.Net supports AtomPub which is protocol for publishing content).

Windows Live Writer easily installed on my machine. After installation completed you will be asked about your blog information and if your blog supports AtomPub then you can continue to enter login information of your blog. With a quick search I found in WiKithat Windows Live Writer supports BlogEngine.Net so I selected “other blog service” option in this form.

What blog service do you use

In next step you’ll be asked about your blog address and username and password.

Add a blog account

For me as a developer it was surprising that Windows Live Writer supports plug-ins. first thing I looked for was SyntaxHighlighter. Yes! . I’s already been developed. there is a project in CodePlex named “SyntaxHighlighter for Windows Live Writer” you can easily download and set it up.

Written by Ahmadreza Atighechi

August 4, 2010 at 7:46 pm

Posted in Blog

Tagged with ,

How to mess with "click test" facebook application

with 3 comments

Couple of days ago I came across a fantastic challenging application in Facebook which is called “click test”. This application measures your click per second and you have to click as much as you can in 10 seconds. For sure in my 130 friend there are many who can click more than me, but I had to do my bests especially a friend of mine (Kambiz) who is not only good at typing and clicking but also good programming. What should I do! should I left the battle or keep challenging? Of course I have to stay in this battle. I tried to score a good click per second but honestly the best I did was about 90 clicks per second which is lower than lots of my friends.

What is “click test” application? This is a simple but

ton that you have to click on with a countdown timer which runs inside browser. Ok, the first thing pops in mind is writing a simple application to simulate clicking on this button. Ohhh, you have to find browser windows handle then use SendMessage with appropriate (wParam, lParam) parameters to simulate clicking on specific area of window. That sounds great. But the fact is I’m more JavaScript and HTML guy than *API* guy. So let Keep It Simple Stupid (KISS).

If you view source of “test” application page you’ll face huge amount of complex source code which is really complicated. At the beginning I wanted to find the function which is responsible for counting down t from 10 to zero and then increase it but the code is really messy and it takes time to find the function you want. Should I inspect all HTML and Jscript source code? The answer is No

Recently browsers are delivered with quite sophisticated feature for developers. For example Internet Explorer 8 has got famous feature which is called “Developer Tools” and you can activate it by pressing F12. Having pressed F12, nice window will be displayed to help you debug your HTML and JavaScript.

Ok to find start button you can press Ctrl+B or select Find -> Select element by click.

Then move your mouse to element that you want inside browse.

As soon as you move your mouse inside browse you’ll notice that browser mark current element by bordering it. So find start button and then click on it. Gotcha! Developer tools automatically scrolls to input tag related to selected element. You can also scroll horizontally to find “onmouseup” which is actually responsible for counting your clicks. Ok, double click inside onmouseup and then press Ctrl+A to select all body of onmouseup.

So I can copy this element into clipboard and then paste in notepad. You may also have somthing similar to following:

fbjs_sandbox.instances.a130168443678744.bootstrap();
return fbjs_dom.eventHandler.call([fbjs_dom.get_instance(this,130168443678744),function(a130168443678744_event)
{a130168443678744_game.update($FBJS.ref(this).getForm())},130168443678744],new fbjs_event(event));

Actually this is an event handler and this code runs every time you click on your mouse button. But it’s rather complicated. It calls a function at first and then calls another function. So If I want to change this code I have to find these functions and then change body of them.

But what if I don’t change any code and just make this event handler to run multiple times per click. That is sound good idea. So let copy and paste event handler for couple of times. But I should notice that second function call has “return” and I have to remove it for my new copies, and just leave it for last one.

fbjs_sandbox.instances.a130168443678744.bootstrap();
fbjs_dom.eventHandler.call([fbjs_dom.get_instance(this,130168443678744),function(a130168443678744_event)
{a130168443678744_game.update($FBJS.ref(this).getForm())},130168443678744],new fbjs_event(event));
fbjs_sandbox.instances.a130168443678744.bootstrap();
fbjs_dom.eventHandler.call([fbjs_dom.get_instance(this,130168443678744),function(a130168443678744_event)
{a130168443678744_game.update($FBJS.ref(this).getForm())},130168443678744],new fbjs_event(event));
fbjs_sandbox.instances.a130168443678744.bootstrap();
return fbjs_dom.eventHandler.call([fbjs_dom.get_instance(this,130168443678744),
function(a130168443678744_event)
{a130168443678744_game.update($FBJS.ref(this).getForm())},130168443678744],new fbjs_event(event));

As you see I copied all code for three times and left return just for last call. It means my clicks will be tripled and I can register 150 clicks just for 50. It’s good. So let’s copy this code back to onmouseup element it is ready for testing.

Enjoy it!

Written by Ahmadreza Atighechi

July 27, 2010 at 5:07 am

WEBCAMPS Sydney Day 1 / Part 2

with 38 comments

As first day continued Scott and James tried to demonstrate Microsoft ASP.net 4.0 and MVC 2. Same question about ASP.Net was asked and was answered. Fellows was worried about replacement of ASP.Net with MVC 2 and as it was answered and like before Scott and James defined that ASP.Net is not going to be replaced by MVC. It is just a new approach of implementing web applications and depending on website structure and content websites could either be implemented by ASP.Net 4.0 or MVC 2.

Couple of new project templates has been added to Visual Studio 2010 and in web. One of them is “ASP.NET Web Application”. When a new ASP.NET Web Application is created visual studio automatically creates folder and files which are needed for a simple application. This type of project unlike

previous web application is not an empty project and contains necessary files and folders to create a simpl

e application.

This template includes Microsoft ASP.NET Membership Provider and if SQL Server Express is installed on developer machine this type of project is automatically configured for ASP.NET Membership provider which connects to SQL Express. This type of Web application is similar to ASP.Net application because the theme and style looks like default theme of ASP.Net MVC Application. Good news is Micros

oft has added jQuery to ASP.Net web application and ASP.Net MVC 2 Web application templates.

I think one of best features of MVC is its testability and on top of that you can change test framework of testing if you want. I’ve find some good articles and posts about adding customized test framework for testing MVC 2 projects. How to: Add a Custom MVC Test Framework in Visual Studio and a post about NUnit Template for ASP.NET MVC 2 .

Presenters created a new MVC2 Web application and for beginning they created a project without database just to keep it simple. View, Mode was discussed in this session and they talked about partial views and templates. I wanted to describe creating templates in MVC 2 but I found a good sample in Microsoft that helps to understand how to create templates in MVC. Following is link to EditorFor extension method. On the bottom of page you can find a link to Template Helper Sample.

For describing model part of MVC a virtual project was defined named Plan My Night. It was a simple application to plan night. They described model and controller by creating a simple database and entity model to implement Plan My Night. During implementation o f Plan My Night they described partial views editor templates. For editor templates there is a good sample to create an editor template for datetime inputs called MVC2 Editor Template with date and time.

They combined sample with newly introduced feature called jQuery Templates Data Linking. You can find a complete sample in ScottGu’s Blog. Another cool feature of visual studio which is really useful is Dynamic JavaScript Intellisense in VS 2010. Not only client items in win form can be identified by intellisense of VS 2010 but also items which are being created by developer during development can be identified in VS 2010 like following picture. 1000 items with TestDev prefix is added to window object. Exactly after while command you all TestDiv0 to TestDiv1000 is added to suggestion list.

During the presentation Scott wanted to use a trick to cause a crash for visual studio 2010 (It was on purpose). He changed “while” condition to an infinite while condition and he expected VS to crash when suggestion list was being opened, but visual studio is clever enough and calculates list until certain amount of millisecond and if it’s going to be time consuming visual studio just ignores rest of computing and jump over next statement. There is a good post in ScottGu’s Blog about JS Intellisense and its improvements.

Other feature which was discussed in webcamps was about Web.config transformation and packaging and deployment of web application SQL server. There is a good clip about Web.Config transformation in channel9 about Web Deployment and Web.Config.

 Rest of presentation was about IIS extensions which are available on http://www.iis.net/download and can be downloaded and installed by Web Platform Installer. Among those extensions SEO Toolkit was fantastic which was shown by Scott.

At the end of presentation fellows were asked to pitch their ideas for next day. Following are some of projects and people voted for them

.

My Noisy Neighbour (I voted this project)

RaceDay Commander

MongoDB Management Studio

Due Date – lightweight task-tracking for uni students

Address Book Lookup

I voted for first project “My Noisy Neighbour” and in second day I had to join to a group of people to develop this web application based on what we’d learned in first day. In the next post I’m going to describe what was our project was and what had happened.

Written by Ahmadreza Atighechi

July 9, 2010 at 5:59 am

Posted in Blog

Tagged with , , , , ,

WEBCAMPS Sydney Day 1 / Part 1

with 7 comments

WEBCAMP was a 2 days event that provides a chance to learn and build projects based on Microsoft Web Platform. WEBCAMPS is held in different cities around the word and I had chance to participate in Sydney WEBCAMP event in 28 and 29 of May 2010. Interesting point is performers of this event in Sydney were Scott Hanselman and James Senior who I really wanted

to be in one of their presentations specially Scott that you’ll never be tired in a conference in case Scott is one of presenters.

Map picture

This presentation is held on Powerhouse museum in Ultimo.  Seminar star

ted at 9:00 and in day one approximately 400 attendees was in event. However, in day 2 number of attendee had dropped sharply to less than half of day one. But that was predictable because day 2 you could participate in lab or build your own application or even participate in a group to develop an application based on what you’ve learned in first day.

Day 1 Contents:

Day 1 started with introduction of Microsoft Web platform installer.

Microsoft Web Platform Installer or Web PI is a free installation application which based on your requirements installs services, frameworks, tools or databases you need to install a specific application. Web PI helps you prevent redundant task which is common in installation different project. Web PI check you system and depending on your machine configuration suggest Framework, Servers, Databases and available applications. By aid of Microsoft Web PI you can install Web application like DotNetNuke or

Umbraco CMS or even Jumla! The good point is some application like Jumla is php based and Web PI know their installation requirements and install selected program based on setting. No need to say that depending of operating system and system Web PI suggest different set of application.

In day 1 James Senior tried to install Umbraco CMS in demo Umbraco CMS with database and other requirements was installed on demo machine.

Good point is Web PI installs on a machine as well as IIS and user can run it repeatedly to configure server and installed application and components.

In day 1 presentation has slides to justify that MVC is not a replacement for Microsoft web solution and MVC is just another approach for web development. ASP.Net MVC is an open source project done by Microsoft and you can find it here.

As the seminar continued one of features of ASP.Net 4.0 was introduced named “ASP.Net Dynamic Data Entities Web Application” Or “ASP.Net Dynamic Data Linq to SQL Web Application”. The first one uses entity framework for data layer but second uses Linq to SQL as data layer.

As far as I remember these two ASP.Net Extension projects was introduced by Visual Studio 2008 SP1 in 2008. Here is some useful videos for creating and customizing Dynamic Data web applications.

http://www.asp.net/dynamicdata

These project types are useful for creating administration pages from scratch. All you need to do is create your database and relations. Create a project type either Entity of Linq to SQL and select entities you want. Suddenly you find that All CRUD (Create/Remove/Update/Delete) of your entities is created in user friendly URL by using “DynamicDataRoute” class.

Following is steps to create an administration web site for Northwind in less than 2 minutes:

1. Create a new web project type Asp.net Dynamic Data Entities Web application.

2. Copy Nothwind Database files (MDF and LDF) in APP_DATA folder.

3. Right click on project and new data item type ADO.Net Entity Data Model.

4. In wizard form select “Generate from database” item.

5. And then select NORTWIND as data connection.

6. Select tables you want to be added to Entity Data Mod and then click finish.

7. Open Global.asax and then remark line starting with DefaultModel change this line as follow.

DefaultModel.RegisterContext(typeof(NorthwindEntities), new ContextConfiguration() { ScaffoldAllTables = true });

8. Press F5 and run the application.

Simple, Easy and beautiful, It’s a good solution for quick data administration generation. And the good thing is all templates are editable and you can change them.

Written by Ahmadreza Atighechi

June 7, 2010 at 1:39 am

Posted in Blog

Tagged with , ,

Starting an Australian life

with 6 comments

 

 

After 22 months our (me and my wife) Australian permanent visa is granted. These 22 months of my life was so hectic. This is a big break in my life and I’m looking forward for shiny future. My visa was issued on 18 of January and new level of my migration is started.

There are tons of things to do in order to settle in:

 

1.       Sell our stuff including my car

2.       Rent my apartment

3.       Open a bank account in Australia

4.       Transfer money to Australia

5.       Send our stuff to Australia by AIR shipment

6.       Move into temporary accommodation for one or two weeks in Sydney

7.       Receive the AIR shipment.

8.       Move into Mid-level temporary accommodation for couple of mount

9.       Get a mobile phone including device (Hopefully buy an HTC HD2)

 

And last by not least

10.   Finding a new job in Sydney

 

I think the last one is the most important thing to focus on. I have to improve my English abilities, Prepare a professional Resume and covering letter for each vacancy, which I apply, improving my technical abilities in various aspects.

 

 

 

Written by Ahmadreza Atighechi

January 31, 2010 at 8:15 pm

Posted in Blog

Tagged with ,

Follow

Get every new post delivered to your Inbox.