Wednesday, November 18, 2009

IIS Web Core Notification - BeginRequest Handler Not yet determined Error Code 0x800700b7 Config Error Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'ScriptHandlerFactory'

 

Situation

1. Visual studio 2008 SP1

2. IIS 7

3. Hosting WCF within site with a VDir.

This happens typically when you are hosting with hosting provider.

If you create a website in main folder (Which will be by default ) and you host a ASP.NET web site. Doesn't matter if it is AJAX or simple website. With SP1, we have 'ScriptHandlerFactory' with any web application.The site works perfectly.

 

Now if you are creating a service say a WCF service under a Vdir in this site, you will have a different Web.config for your service. Service will run fine locally. When hosted, The website will inherits the settings form parent level . This should be the reason of this issue. You can check if there is a web.fig file in the parent web content folder and an duplicate collection entry in it.

Typically a duplicate entry from services config needs to be removed.

Monday, September 07, 2009

Google App Engine – Can it replace Microsoft share Point?

It was fun reading the article at http://googleappengine.blogspot.com/2009/09/app-engine-sdk-125-released-for-python.html

Google app engine is now supported over windows as well. here are my observations -

1. Go to world with your web application within minuets. Could not find any Microsoft product / service in competition to this. 

2. Use Goggle’s Infrastructure to host, bandwidth and CPU time upto 5 million users per months for FREE!!!

3. Pay as you use after that.

4. Extensive integration with Eclipse and one click deployments.

5. Super cool UI with Google analytics and dashboard and I was feeling like I am in datacenter with my laptop.

6. Here is the Kicker – User JDO (Java data objects) and Google Authentication to use authenticate your users.

7. URL mapping off-course. Users wont even know that your www.xyz.com is hosted on Google servers.

I was thinking if any one can use the templated Servlet to create a team site like in sharepoint, then there is no licensing, now no more deployments and developmet and UI? is just like you any web development. On top of that you can convert the old apps as Google app engine app and host it on Google.

Is this a Google’s answer to sharepoint and Microsoft Cloud computing?

Tuesday, September 01, 2009

New Trend in Application development for IT organizations.

Just wanted to put a quick note on a great article that I came across here.

This is a poll conducted by Gilbane Group on Facebook for finding out the future of collaboration technology in near future.

This un-official  poll was for 1000 users and for different age group 18-24 and 25- 34

here are the results - gilbane_facebook_poll_6_19_07

Here is what I think -

1. People want to take the collaboration technology in their everyday business. More younger people would do this more Look at the SMS text Mode.

2. Social networking and Blogs are not very Popular – Will today’s Tons of Startups in social networking survive?

3. Future information worker will try to use new modes of IT not only as communication medium but in their everyday life and at work .

4. IT organizations should recognize this trend and seek to provide solutions with the flexibility to meet the technology demands of information workers.

Silverlight3 GridView Binding, LoadingRow events and Textblock traps

Those from ASP.NET background, moving forward to silverlight3 and playing around with Grid view my get frustrated at times. Grid view is one of the most widely used controls and we do want to change the contents of the Grid when we Bind the data. Sounds very simple but could be tricky at times.

I was developing prototype in Silverlight and Found few interesting things and thought I would share.

  1. So you bind the data to a grid, using AutoGenerate columns or not, Doesnt matter. To track the "GridView.RowDataBound" on row data bound event you create a backend event handler like this.
    grdEntries.LoadingRow += new EventHandler(grdEntries_LoadingRow);
  2. Getting event handler is tricky, here is how you get it working.  Note the 3 methods of getting the cell content in C# code. image

About this get parent function – this casts the cell to appropriate type – Note the way this function is called recursively.

The Above code may not work when you scroll the grid, for some wired reason it keeps binding the data again and again. For this, Alternative solution could be to use the individual column loaded even. Here is how you do it.

Both type of columns are shown here

<!--<data:DataGridTextColumn Binding="{Binding Date}" Header="Entry Date" Width="175"/>--> regular column which works with LoadingRow event handler

<data:DataGridTemplateColumn Header="Date" SortMemberPath="Date">
<data:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Loaded="TextBlock_Loaded" x:Name="txtDate" Text="{Binding Date}">
</TextBlock>
</DataTemplate>
</data:DataGridTemplateColumn.CellTemplate>
</data:DataGridTemplateColumn>

In the code behind, track the column and change the text or whatever you want to do.

void TextBlock_Loaded(object sender, EventArgs e)

     {

          TextBlock tb = sender as TextBlock;

          tb.Text = "Amol";

      }


Now why we have so many options? There are some performance reasons in data grid and it all depends which one to use whe. Typically, if you want to change data every time you bind grid, go with Loading row handler. If it static change and grid is not going to change then use the column loaded event.

Thanks

Friday, August 28, 2009

Passing Parameters to Silverlight 3 Application from ASP.NET

Steve has excellent article here

However, For starters, I thought I would put down the steps quickly here

1. biggest change and where I struggled, How to create a parameter in ASP.NET page, the control is gone. Well, is here to help us. In the Object Tag, add line  -



2. in Code behind in ASPX, use this control to set the property on any event. 2 things to remember here, Use the ".Text" to set the key value pair like this.
Source.Text ="Param1="+ Param1.ToString();

3. In App.xaml.cs, in Application_Startup event, simply add  2 lines, and your total code should look like
this.RootVisual = new MainPage();
foreach (var data in e.InitParams)
   this.Resources.Add(data.Key, data.Value);

4. In MainPage.xaml.cs you want to access this, Simply use following construct.
App.Current.Resources["Param1"].ToString();
Note - Create a Loaded even in MainPage.xaml otherwise we will get. Final code should look like


public MainPage()

{    InitializeComponent();
    this.Loaded += new RoutedEventHandler(MainPage_Loaded);
}


void MainPage_Loaded(object sender, RoutedEventArgs e)
{     string param 1 = App.Current.Resources["Param1"].ToString();
}

Tuesday, March 10, 2009

The 'Microsoft.Jet.OLEDB.12.0' provider is not registered on the local machine !!

This is rather simple error to Fix if you are a developer and building small scale application.

Error comes becase you dont have Office 2007 installed on machine. Most of developers install it and goet going :)

Few other they go for http://www.microsoft.com/downloads/details.aspx?familyid=7554F536-8C28-4598-9B72-EF94E038C891&displaylang=en - Better way,

PROBLEM -

1. Lets say you are hosting your web site on shared host server. Hosting company may not install this Driver!!!!!

2. Another bigger problem, if your application is load balanced, how do you or hosting company know where to install this driver? On all nodes?

There is a intersesting solution to this problem, Cant share here. Hope microsoft will address this with MDAC and OS install :)