Annoying VS2008 and IE8 script debugging glitch

by dotnetpete 16. September 2009 09:36

I came across a very annoying problem with VS2008 and IE8 where you can't turn off script debugging.

The workaround is documented here where you download the silverlight tools for VS2008 SP1 and turn on silverlight debugging. Because the debugger can't debug javascript and silverlight at the same time, javascript debugging is effectively turned off. Interestingly, to enable silverlight debugging I had a slight variation to the steps below.

Right click on the project -> properties, go to the web tab, and check the silverlight option under debuggers.

The original steps are: 

  1. This work around requires the Silverlight 2 Tools for Visual Studio 2008 SP1 to be installed. So if you don't have these tools installed, you can download them from Microsoft (download here). If this is not an option for you, there is some alternative work arounds at the bottom of this blog post.
  2. Right click on your project and open up project properties
  3. Go to the 'Start Options' sheet, and click the 'Silverlight' button at the bottom of the screen. Because the debugger cannot debug both Silverlight code and Script code at the same time, this will disable Script debugging and therefore avoid the problem.
Alternatively you can turn off script debugging altogether:
  • Open a new command prompt (start->run, cmd.exe). If you are on a 64-bit computer this needs to be a 32-bit prompt (start->run, c:\windows\syswow64\cmd.exe)
  • reg add HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\AD7Metrics\Engine\{F200A7E7-DEA5-11D0-B854-00A0244A1DE2} /v ProgramProvider /d {4FF9DEF4-8922-4D02-9379-3FFA64D1D639} /f
And to re-enable:
  • reg add HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\AD7Metrics\Engine\{F200A7E7-DEA5-11D0-B854-00A0244A1DE2} /v ProgramProvider /d {170EC3FC-4E80-40AB-A85A-55900C7C70DE} /f

Happy non-script debugging.

Tags:

Visual Studio

Awesome SQL Tools

by dotnetpete 10. September 2009 14:33

Attended Wardy's SQL talk this morning about SQL Server 2008 consolidation.

Many reason's to consolidate not least that you can save on SQL Server license fees.

A few very handy tools emerged that were suggested for use when determining if consolidation is appropriate but could also be used when investigating performance problems and tuning SQL Servers.

The first is Microsoft Assessment and Planning Toolkit here. This tool does more than just document your SQL instances. Good option for an IT audit document.

The other tool specific to SQL Server performance tuning is SQLIO (Disk Subsystem Benchmark Tool) here.

This tool places you SQL Server under artificial load to stress the IO subsystem under configurable circumstances. You can simulate reads and writes, specify the number of threads to use, specify the io queue length, specify random or sequential writes and more.

Random writes simulate inserts and updates where as sequential writes simulate log file writes.

Tags:

SQL

Hello from Tech.Ed 09 Gold Coast

by dotnetpete 8. September 2009 18:26

Just arrived at Tech.Ed on the Gold Coast and thought I'd write an entry using my groovy HP Mini 2140 that every delgate gets.

Windows 7 pre-loaded and it's very nice!

More to come from Tech.Ed 09.

Tags:

The all important EnableVisualStyles

by dotnetpete 8. September 2009 14:15

A project I have been consulting on had an issue with treeview images sometimes not apprearing correctly and inconsistently so.

It turns out that the last of the call the EnableVisualStyles on the main entry point caused this issue.

I still have to investigate the workings of EnableVisualStyles to work why it is so.

Tags:

Visual Studio

Another use for Ctrl-K,D in ASPX markup

by dotnetpete 3. September 2009 14:11

I wrote about the very handy Ctrl-K,D command on Visual Vtudio that formats code in ASPX files as well here.

Another handy "feature" in ASPX markup is that Ctrl-K,D does nothing if there is a errorin the ASPX file i.e. no matching end tag etc.

And as I found out, no matter how hard you try the key combination, it wont format is there is an error!

Tags:

Visual Studio

SQL 2008 replication madness

by dotnetpete 20. July 2009 20:35

I had to setup replication today over a relatively slow link. It was all going ok and I was viewing progress with the replication monitor and I kept getting errors about the replication not being able to contact the subscriber in the last 10 minutes.

I have read posts about being to use the sp_changedistributor_property stored procedure to change the heartbeat_interval but when I ran the profiler on the subscriber database there were replication statements still chugging away.

The replication monitor was showing the error icon and the error in the detailed error text area but in the grid above it would ocassionally tell me the actual operation that was being performed.

Long story short, eventually the replication initialisation completed sucessfully but it appeared there several times that it had hung or stopped becuase of the error.

Also when I right clicked on the subscriber node within management studio and selected "View Synchronisation Status" it showed that the agent was stopped (start button enabled and stop button disabled), but when I hit start it told me that there was a process already running.

Madness!! 

 

Tags:

SQL2008

Innovative use of the SQL Server row_number() function

by dotnetpete 17. July 2009 13:21

I came across an interesting use of the row_number function today. Say you have a situation where you want to select the first address for an account that may have multiple addresses. You can use the row_number() function to create a query table and then select where row number = 1.

Previously you would have had to create a temporary table in a stored proc to achieve this. Very neat being able to do it this way!

SELECT *

FROM Account a

LEFT JOIN (SELECT *, row_number() OVER(partition BY AccountID

ORDER BY CASE AddressType WHEN 'main' THEN 0 WHEN 'mailing' THEN 1 ELSE 2 end) AS 'RowNumber' FROM AccountAddress ) AS addr

ON a.accountid = addr.accountid AND addr.rownumber = 1

Tags:

SQL

Length of image columns - DATALENGTH function

by dotnetpete 25. June 2009 17:42

I needed to find the length of an image column in the database. You can use the LEN function on varbinary columns but not image columns.

The DATALENGTH function however does work very nicely. 

Tags:

SQL

More WinForms madness

by dotnetpete 24. June 2009 22:10

We recently upgraded a .NET 1.1 app to .NET 3.5 and had some issues with anchoring of controls and in one case on a client machine they got an OutOfMemoryException. 

It turned out that the conversion had set the font for this form to be MS San Serif with controls on the form Tahoma. Changed the form's font to Tahoma and anchoring going again and no reports of errors from the client. Yet. 

Tags:

WinForms tab control madness

by dotnetpete 24. June 2009 21:48

When you drop a WinForms tab control on a form, 2 tabs are auto created for you. Nice! However new tabs are not created equal. Any new tabs that are created are not padded where as the defaults tabs as padded 3 pixels left, top, right and bottom. 

 Madness! 

Tags:

Visual Studio comment/uncomment shortcut keys in config files

by dotnetpete 28. May 2009 16:49

Visual studio's shortcut keys for commenting (Ctrl-K, C) and uncommenting (Ctrl-K, U) and very handy for blocks of code or even singles lines if your cursor is not at the start of the line.

Something interesting though is that these shortcuts also work within the config files putting <-- and --> at the start and end of the line(s) as required (or removing them if you're uncommenting).

Very handy if your development config files contain multiple connection strings etc. 

Tags:

Visual Studio

Undocumented sp_MSforeachtable stored procedure

by dotnetpete 29. April 2009 13:31

Found a very cool undocumented stored procedure in SQL today.

For example if I want to rebuild all indexes for all tables I could do

sp_MSforeachtable @command1="print '?' DBCC DBREINDEX ('?')"

Very handy! 

Tags:

SQL2008

Missing indexes notification in SQL 2008

by dotnetpete 23. April 2009 11:55

Came across a very handy feature of the actual and estimated query plans today. When I ran the query I was tuning at the top of the query plan window underneath the query, the following text appeared:

Missing Index Details from Queries 2.sql

The Query Processor estimates that implementing the following index could improve the query cost by 88.9016%.

If I right clicked I got the option to choose the "Missing Index Details..." option which opened a new query window with the index create statement ready to run (I just had to supply the index name).

It was smart enough to suggest index columns and included columns for the index as well. 

 

Tags:

SQL2008

Replication in SQL2008 of XML data type columns

by dotnetpete 27. March 2009 16:35

Seems that XML data type columns are not replicated (via merge replication anyway) between sites. Bummer! 

My table with the XML data type column had data at one site, not at the other and vice versa. 

Luckily I'm not doing anything XMLy on the data (I didn't create the column but I wouldn't have forseen any concequences like this either), so I was able to create a new varchar(max) column and populate at each site. The data is the replicated to each site ok.

Would nice to have a pre-replication utility to rip through a database and warn for these types of situtations. In a previous post I ran into a similar issue with transactional replication and update of text columns at a subscriber. 

 

Tags:

SQL2008

Visual WebGUI

by dotnetpete 27. March 2009 12:29

I'm doing some consulting as a company who are trying to speed up delivery of CRUD web forms and are looking at a product called Visual WebGUI.

http://www.visualwebgui.com/

Looks pretty interesting. At design time you seem to be working with WinForms forms and controls and then at runtime it translates this into HTML. 

At runtime it generates the equivalent HTML and does a lot of stuff client side. I had a button and a textbox on my form. On click of the button I set the text of the textbox to "Clicked!" and there was no postback. 

Anyone with experience with Visual WebGUI, I'd love to hear what you liked and what you didn't. If you had the time over would you still have used it? 

 

Tags: