Tag Archive: .net framework


I am using ADO.Net Enity Framework 4.0 in my current sample learning project (WCF REST Service Application) and I am also using POCO entities to map objects that are in Entity Model.

As I am working with N-tier architecture, I am having my POCO entities, Entity Model and my executable service page(start up page) in separate projects. My ObjectContext class (for mapping entities in entity model and POCO entities) is in project with POCO entities.

Issue :
Now as I tried to run my service project and navigate to “http://localhost/PronerveEPMS/PronerveRestService/Accounts” for getting all “Accounts” in my database, my code raised the Exception “The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.”. See the figure below……..

Click the image for full view

Solution :
Now the issue was my connection string of Entity Model was in app.config file(by default) with Entity Model and so when I was executing my service project it used to search connection string in web.config file of service project and so not found it.
And so as a solution i just put my default connection string of Entity Model in web.config of service project and also need to add reference of the project containing Entity Model in executable service project.

ok, now searching for the solution to this issue I found that many developers were searching for the exact connection string to use with entity model and so here is my connection string….

<add name="pronerveEntities"
connectionString="metadata=res://pronerve.data.sql/pronerve.csdl|
res://pronerve.data.sql/pronerve.ssdl|
res://pronerve.data.sql/pronerve.msl;
provider=System.Data.SqlClient;
provider connection string=’Data Source=NIKHILTHAKER-PC;
Initial Catalog=pronerve;
User ID=sa;
Password=xyz;
MultipleActiveResultSets=True’;”
providerName=”System.Data.EntityClient” />

Here “metadata” part of the connection string points to the auto generated csdl, ssdl, msl files which contains the schema and other information about the database used by Entity Model.

Second thing is ‘pronerve.data.sql’ (bold sections in connection string), which is the name of my project that contains Entity Model, can be replaced by simple ‘*’ but it is always reccomended that you always use the proper assembly name in such scenarios. For more details on this, just go to here… http://msdn.microsoft.com/en-us/library/cc716756.aspx

For more on ADO.Net Entity Framework please go to, http://msdn.microsoft.com/en-us/data/aa937723.aspx

I will also talk more about POCO entities in .Net 4.0 in some other blog.

For last 3-4 days I am trying to understand the RESTful architecture for applications.
And so for start I have created a sample REST service using “WCF REST Service Application” template in Visual Studio 2010 RC and .Net Framework 4.

At first I have tested service operations of my REST service with ‘GET’ & ‘POST’ and they were working absolutely OK.
(I have not created any client yet to test my RESTful service but I am using ‘Fiddler‘ for the purpose.)

Now when I have started testing with ‘PUT’ verb in my request to REST service through fiddler, it has returned Http Error 405 (‘Method not Allowed’).
Then I started testing ‘DELETE’ and it was also not working with the same Http Error 405.

As I am like newbie to REST Services and IIS stuff and all that, I have not understand the error described in Image above.
So I have googled this Error a lot but not found the appropriate answer and so ultimately put the question on official IIS forum as I have found by the time that, this Error is related to IIS……

Link to IIS Forum My thread ==> http://forums.iis.net/t/1166025.aspx

And Bingo……. I got the answer from the forum so quickly and that just simply worked.

The issue was WEB DAV module on IIS was throwing the Http Error 405 as it was claiming to process the request sent by my application on IIS, but my application is not configured to process it with WEB DAV module which do not support ‘PUT’ and ‘DELETE’ verbs by default.

So as a solution I have just removed WEB DAV module from my IIS 7…….
Go to IIS Manager ==> Default Web Site ==> MyRESTApplication ==> Modules(In Features View) ==> WEB DAV Module (On module right click) ==> Remove

Now evrything in my RESTful application works just great…

Hi Everyone,

Visual Studio 2010 and .NET Framework 4 Release Candidate is just out on 10th February for public.

Visual Studio 2010 RC Image


Download links for VS2010RC :

  • If you have a download manager that can handle a large file, click here to download the ISO image directly.
  • OR You can download the ISO image in 4 parts from here.

Install and Upgrade Instruction :

1.> You can install VisualStudio2010RC side by side to VisualStudio2008 SP1

2.> You can not install VisualStudio2010RC side by side to VisualStudio2010Beta2

So first uninstall the VisualStudio2010Beta2 and all its components from Uninstall Programs (previously “Add or Remove Programs”) and then only install the VS2010RC.

For more details on downloading Visual Studio 2010 and working with ISOs, go to this link.

For more details on what’s new in Visual Studio 2010 RC, just go to walkthroughs of VS2010RC.