Moving VS 2008 Web Apps to IIS 7

Moving off of Windows XP and over to Windows 7 on my work computer has been trying. My latest problem has been getting a Visual Studio 2008 web application to run. Every attempt to run the application in Debug mode resulted in the following error message:

Unable to start debugging on the web server. Check for one of the following.1) The application you are trying to debug uses a version of the Microsoft .NET Framework that is not supported by the debugger. 2) The debugger has made an incorrect assumption about the Microsoft .NET Framework version your application is going to use. 3) The Microsoft .NET Framework version specified by you for debugging is incorrect.Please see the Visual Studio .NET debugger documentation for correctly specifying the Microsoft .NET Framework version your application is going to use for debugging.

To correct this issue, I ran the IIS 7.5 Manager and located my web app on the tree. I right clicked it and selected Manage Application/Advanced Settings.

Then I set the Application Pool to ASP.NET V2.0 as shown below. This fixed the problem.

Share

Internet Explorer Rendering Problems

Where I work, we ‘officially’ support Internet Explorer. In my web applications, I try to support Firefox, Opera and Chrome as well. It is not too hard these days. But I did find one issue recently with IE. On my local development box, IE was rendering the web site one way, but when I deployed it to our intranet, I was seeing a different (and less attractive) look.

Continue reading

Share

System.Data.OleDb.OleDbException: Unspecified error

815492_30356691If you are getting an error like the one below in your ASP.Net application when trying to open an Excel or Access file, you may need to reset IIS.

System.Data.OleDb.OleDbException: Unspecified error
at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.OleDb.OleDbConnection.Open() at

To reset IIS:

  • Open a command prompt on the box running IIS.
  • Issue the command: iisreset

My situation was that I had code that had previously worked, but it just stopped working one day with the error mentioned above.

Hope this helps.

Share

Visual Studio bug: asp:UpdatePanel could not be set on property ‘ContentTemplate’

So, I ran the Secunia Online Vulnerability inspector on my work PC and noticed there were over a dozen missing patches. I ran WindowsUpdate and had to reboot.

After rebooting, I reloaded Visual Studio 2008 and my ASP.Net project that I’m working on. I noticed that the designer was unable to render on any of my pages that had an updatePanel and the error I got was:

asp:UpdatePanel could not be set on property 'ContentTemplate'
Continue reading

Share

Keeping a Session Alive

waveformIt seems like such a simple thing, I’m amazed it’s not part of Microsoft’s whole webform architecture. I would like to keep a user’s session from timing out as long as he/she is still on the web page. Just ping the server, so to speak, periodically, to let it know that this session is still being used, even if the user has gone to lunch, gotten interrupted by a phone call or coworker, etc.

I’ve tried numerous ‘solutions’ that I have googled (jQuery heartbeat plugin, other javascript based things, AJAX controls, etc), but the only one I’ve gotten to work, is also about the simplest one I could find. It’s by Thomas Kurek and posted on Code Project.

http://www.codeproject.com/KB/session/Session_Defibrillator.aspx

So far, it has kept a session alive for over 16 hours. Keeping my fingers crossed that this one will be ‘the one’.

Share

Property Macro

Frequently, I find myself needing to add a property to an existing entity. Manually typing the property definition is tedious. So, I created a macro to aid this process. Once we move to Visual Studio 2010, this won’t be needed, but until then, it should be pretty handy. (VS2010 will add a new shortcut for creating a simple property with just one line of code.)

Continue reading

Share