Sunday, November 08, 2009

IE Javascript Error: object doesn't support this property or method


Error: Object doesn't support this property or method

I debug the DOM and noticed that none of the extended prototype functions provided by the prototype.js framework (http://prototypejs.org) were register with IE.

No problems with FF (as usual) and other browsers but IE was just not registering the extended functions. After some time debugging I concluded that the error was caused by multiple prototype versions. I didn't have multiple prototype.js files register but instead one of the chat software used in the site had it's own prototype functions that were conflicting with the prototype function $().

Removing the function $() from the chat software solve the problem.

The other solution was to register the prototype.js file at the end of the page so that I will override any other prototype functions registered.


Solution:
Check for multiple prototypes.

Wednesday, September 30, 2009

TFS VS.NET 2008 Testing Fails Corrupt Installer

I recently tried to install vs.net 2008 for testers and was not able to run testing projects succesfully.
I was getting the this error:




I tried re-installing vs.net 2008 for testers ( I already had vs.net Team Foundation 2008 installed) but I had error with the installer.

These are the errors in the Application Event Logs:

Error in Template (C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\Web\VisualBasic\1033\AdoNetEntityDataModelVB_ASPNET.zip), file (ModelObjectItemVB_ASPNET.vstemplate). Invalid template element (TemplateID) value (Microsoft.Data.Entity.Design.VSTemplate.ModelObjectItemVB_ASPNET).

Finally I tried to re-install Visual Studio .NET 2008 SP1 and that fixed the problems with the test projects.

My setup was in this order:

1) VS.net 2008 Team Foundation Server
2) Vs.net 2008 SP1
3) Vs.net 2008 for Testers (Didn't work)
So I went back and Re-install SP1 and fixed all my vs.net issues.


Monday, September 28, 2009

Microsoft Enterprise Library Logging Vs Log4NET

I have doing some research about the available logging services out there and found this interesting article. I have used both logging services MS and Log4NET and great thing about both is that configuration is simple and straigth forward. The problem that I had most of the time with Microsoft Enterprise Library Logging Block is that I had to create a wrapper on top so that I can log messages for different categories and handle them little bit different + formatting without having to do a lot of configuration via the configuration files.

Here is the article I am referring.

http://weblogs.asp.net/lorenh/archive/2005/02/18/376191.aspx
Here is part two:
http://weblogs.asp.net/lorenh/archive/2005/03/20/395289.aspx

Whats interesting are his stats.

See below.


Avg Requests
per Sec
% Slower
Than baseline
No Logging (baseline) 470.54
Log4net empty appender 470.46 0%
EntLib empty sink 328.19 30%
Log4net to file 441.05 6%
EntLib to file 260.75 45%

Monday, June 29, 2009

Using Beyond Compare in Visual Studio Team Foundation Server for Comparing and Merging


This is how you get Beyond Compare working for comparing/merging in vs.net TFS. The default viewer is not as great as beyond compare so it comes very handy when you change to bc.


In Visual Studio do the following:

  • Click on Tools menu
  • Click on Options menu item
  • Expand Source Control tree item
  • Select Visual Studio Team Foundation Server tree item
  • Click on Configure User Tools... button
  • Click the Add... button
  • For Extension, type * (for all files)
  • For Operation, select Compare
  • For Command, browse for C:\Program Files\Beyond Compare 2\BC2.exe
  • For Arguments, type /%1 %2
  • Click OK to accept

Do the same for Merging.

Tuesday, June 16, 2009

SQL Server 2008 Annoying warning when saving changes : Saving Changes Not Permitted

When I started working with SQL server 2008 express edition I got a new message that I have not seen in previous versions of SQL Server. The designer does not allow to save table changes like before.

This is the warning message:

Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be re-created or enabled the option Prevent saving changes that require the table to be re-created.
After searching at the options menu I noticed you can disable this warning by unchecking the "Prevent saving changes that require table re-creation".


Since it's a warning message there is a way to remove this simply by unchecking an option in the Tools -> Options -> Designer menu context.
Uncheck the option
"Prevent saving changes that require table re-creation"

This will take care of the issue.
Enjoy!

Friday, January 23, 2009

svn: This client is too old to work with working copy; please get a newer Subversion client

When I tried downloading the latest ActiveScaffold plug-in (script/plugin install git://github.com/activescaffold/active_scaffold.git -r rails-2.2 ) for my rails app. I got this error
svn: This client is too old to work with working copy;
please get a newer Subversion client
I check my svn version and I was running 1.4.6.28521. I downloaded the client from the CollabNet website http://www.open.collab.net/downloads/subversion/ and installed it. At the installer I had to change the install path to match my old installation folder(C:\Program Files\Subversion).

After upgrading to svn version 1.5 i was able to run the plug-in update without any errors.

Thursday, January 22, 2009

CC.NET Fails: Task failed because "sgen.exe" was not found:

When deploying an application to Windows Server 2008 I found the following error.

Could not locate the expected version of the Microsoft Windows SDK. Looked for a location specified in the "InstallationFolder" value of the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.0A". If your build process does not need the SDK then this can be ignored. Otherwise you can solve the problem by doing one of the following: 1) Install the Microsoft Windows SDK for Windows Server 2008 and .NET Framework 3.5. 2) Install Visual Studio 2008. 3) Manually set the above registry key to the correct location.


To solve this I downloaded and installed the v3.5 SDK for Windows server 2008.

This is the ISO:
http://www.microsoft.com/downloads/details.aspx?FamilyId=F26B1AA4-741A-433A-9BE5-FA919850BDBF&displaylang=en

If you are doing it remote you need to download the web installer
http://www.microsoft.com/downloads/details.aspx?FamilyId=E6E1C3DF-A74F-4207-8586-711EBE331CDC&displaylang=en

Wednesday, January 21, 2009

Rails Error: Rails requires RubyGems >= 1.3.1 (you have 1.2.0).

I tried setting up a new rails project today. After I updated to the new rails version 2.2.2, I got the following error when attempting to run my WEBrick server.

"Rails requires RubyGems >= 1.3.1 (you have 1.2.0). Please `gem update --system` and try again.

So I did what It said.

gem update --system
and it returned 'Nothing to Update'

I solved this problem by running
gem install rubygems-update
and then...
update_rubygems

that actually did the updating.
After the gem updates I was back in business.

Friday, January 16, 2009

Javascript to show and hide input default text

Here is a script that I got from one of the sites I worked on.
It has come very handy and re-usable in other sites.

Just add the class 'default_value' to your Textbox or input controls <input class="'default_value' /> and that's it. When you click on the textbox the default text will disappear. If you don't enter any value on blur the default value will be displayed in the input again.