Can’t debug into a MOSS Webpart

I am doing some work at present where I need to debug into webparts hosted in a MOSS 2007 server. Never an easy set of debugging to get right.

To try to ease the process I wrote a WinForm test application that just calls the webpart method with test parameters so I don’t have to go through all the pages I normally would to get to the feature I need, or manually have to attach the debugger to the Sharepoint web process every time.

I added this WinForm project to the same solution as my Sharepoint webpart, this should have allowed me to debug into the webpart project when the appropriate call was made from the WinForm, but it did not work.

Turned out the problem was the Network Service account did not have rights to the C:\Windows\temp and C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files directories. Once write access was granted the IDE was able to create the temporary classes to allow debugging.

Installing VS2008Beta2 from an ISO

I tried to install Visual Studio Beta 2 from an ISO today using the Virtual CD Rom tool. This mounted the ISO fine as drive Z: but when I ran the setup.exe I got an error that it could not load the SITSetup.dll, even though this was in the ISO.

I copied the contents of the ISO to my physical disk and reran the setup and all was OK, so the tip is mounted ISO don’t always work as you expect.

Empty Reports with the eScrum Template

After I installed the eScrum template everything seemed fine bar the reports, only the work item report showed anything, in fact on the other reports their parameter combo boxes were empty. The key difference is the workitem report is drawn form the SQL DBs, while all the other reports are drawn from the OLAP warehouse cube.

If you connect to the SQL server and run the command

select * from dbo._WarehouseConfig where id in (‘LastPRocessTimeStamp’,’RunIntervalSeconds’)

it should tell you when the last update from the SQL DB to the OLAP Cube happened. In my case it was days ago, before I put eScrum on the system, hence the empty OLAP based reports.

So I ran the tool on Eric Lee’s blog that allows to to force an update. After checking the TFS server’s application event log I saw that this had caused the Warehouse Controller Application to start and an update occurred. Why it had not started before I have no idea.

One to keep an eye on.

Losing all files when moving a project in TFS Source Control

Problem

Today I tried to move VS2005 solution in TFS source control from one Source Control location to another (on the same server) as I had put it in a stupid location to start with.

So I unbound the source control (File -> Source Control -> Change Source Control) and then went into Source Control Explorer and deleted the directory and then committed the pending delete. This removed the files in the source control BUT ALSO the local ones on my disk, due to the workspace mapping. This was not what I expected, you use source control so you always have copy, a safety net, I had just lost all of my copies by using source control!

The immediate fix

So I checked the recycle bin and nothing, so I knew I had to use the TFS Power Tools to sort this out. The command required is

tftp rollback

The problem here is that you have to be in a directory that is mapped in your workspace so it can poll your TFS server to find projects. So I changed directory to my C:\project\myproject and ran the tool. It does a get latest against the server then shows a dialog where you can find the changeset to rollback to. I selected the one with the project deletes and hit go and it errored. It said 

Postponing undelete to wait for the filename C:\projects\myproject no longer be occupied.

It turns out that as the changeset included a directory delete tfpt must be able to create the directory, which it could not do as it already existed and I was running the tftp.exe from it.

So I had to change directory to one also in the workspace but not for this solution, and also rename or delete the old directory  and then the command worked OK.

Once this was done I was at least back to where I started. I get get all my files, build the project and check in and out.

How it should be done

The way it should have moved the project, assuming I did not care about the change history, is as follows

  1. In VS2005 load the solution then – file -> source control -> change source control -> unbind the project
  2. The select the solution or project in solution explorer and – file -> source control -> add selected projects to source control. The key point is here you are asked if you want to use the old location or a new one. This option is not should if you do not go via the file menu. Pick a new location.
  3. Once it is moved this way the old branch can be removed. Note that you will have to map the old location to the local disk in the workspace so that the delete options become enabled.

Hope this saves someone a bit of time.

Another stupid way to waste an hour or two…..

When developing SharePoint add-in try to remember if you put a previous version of the DLL in the GAC or not. I have just wasted a couple of hours trying to work out why a new version of a DLL is not being read from a site collection’s bin directory, when there was an old version in the GAC.

Of course this would not have been an issue if I had been checking the version number properly! A good argument for pair programming to avoid these stupid blind spots

Accessing Virtual Server via VMRC through a ISA firewall with Vista

The problem

We have had an insteresting problem, we have a Virtual Server 2007 R2 (Beta), this is accessed both internally on our company network and externally via a ISA 2006 on the Internet. This has been working fine with our XP PCs, but we saw problems when we tried to use Vista.

When on our LAN, the Vista PC was fine, you could connect to the Virtual Server console web page and VMRC to any VPC. We had set our domain *.blackmarble.co.uk as the local intranet in IE security so we were not prompted for for repeated logins.

If the Vista PC was a member of our domain then VMRC login failed outside the firewall, you were still prompted for the ISA login and got to the Virtual Server console but the VMRC failed with an authentication failure, the same happened if I used the VMRC.EXE. However, if the Vista PC was not a member of our domain it worked (and also remember XP worked whether a member of the domain for not).

The Solutions

I contacted Ben Armstrong (http://blogs.msdn.com/Virtual_PC_Guy/) to see if there were any known issues long this line, and there were not, but he made some interesting suggestions that in the end got us to the solution. 

If we temporarily removed *.blackmarble.co.uk from the Vista PCs IE local intranet group and it started to work both inside and outside the firewall, but we had to authenticate a good few times.

We then put the entry for *.blackmarble.co.uk from the Vista PCs IE local intranet group back, and as expected it started to fail again.

We then had a look on the Virtual Server Console, server properties, VMRC server properties. The authentication was set to automatic (the default), we changed this to NTLM. Once this was done the Vista PC could VMRC from inside and outside the firewall without issues.

So I think being a member of the domain was a red herring, it was the fact the PCs in our domain had the IE local intranet set was the key issue.

I am not sure of the route cause, especially as it seem to be Vista specific, it could be:

  1. A kerberos issue on our LAN
  2. Bug in Vista/IE authentication
  3. Bug in Virtual Server 2007R2 (we did try both the beta and RC)
  4. Bug in VMRC.EXE

Anyway at least we have a solution.

Installing SQL2005 SP2 on Vista

We have been having fun installing SQL2005 Developer Edition on Vista PCs with Reporting Services, you need the SP2 for Vista, but installation of  this kept stalling with authentication problems.

Turns out this is the process to follow:

  1. Do a default Install SQL 2005 Dev. Edition
  2. Run the Reporting Service Configuration Tools, make sure that the Reporting Services Process is started.
  3. Make sure the new SQL service has also be started (via control panel)
  4. Run the SP2 package, we were having problems on the login verification page, it said we could not authenticate the Reporting Services login until we had done steps 2 and 3.

Update on my old Dell

I posted in the past about all the problems I had with my overheating Dell 5150, and with the problems trying to Vista Betas working on it. Well an update on both….

  1. After putting new thermal grease on the CPU heatskin it never overheated again
  2. With the release version of Vista every bit of hardware (bar the modem which I quickly found a driver for) was detected and worked first time and I have seen no problems with the PC since.

So I have a healthy, three year old laptop running Vista with the Aero interface (and the 5150 does have a nice high res. screen) perfectly adequately.

This all said I have still moved onto one of our new company standard Acer 8210 Laptops with a Core2Duo running Vista.

Follow up on our nVidia RAID problems

I had posted on problems with the nVidia Raid on our SunFire servers. Well I think I now have the root cause of the problems: not the Sun hardware, the nVidia RAID, or Windows 64 bit drivers.

All the problems we had were when we used mirrored pairs of Western Digital 500Gb SATA drives that we had bought in a single batch of four drives. Identical drives bought on another day were fine, as were 500Gb drives from Maxtor and Hitachi.

After testing these four drives we found three of them kept developing low level unfixable bad blocks, irrespective of the PC, Sun or any other brand, they were used in. It seems when one of these bad blocks was hit:

  • the nVidia RAID caused the mirrored pair to loose their sync and the server hung, when rebooted the server had two drives and the mirror had to be recreated.
  • if Windows Software Mirroring was used we just lost the mirrored pair, at least there was no server hang. The mirror would try to recover – with mixed success, usually failing at the same point each time. However, sometimes working, hence all our confusion in finding the root cause of the problem.

Given this experience we are staying with Windows Software Mirroring as at least the server does not hang.

Now in twenty odd years in this business I have never had three out of four drives fail in single batch, in fact I don’t think I have ever had a ‘dead on arrival’ hard disk from any of the big name brands.

My guess is these four drives were dropped at some point after they left the factory QA department and before we bought them. The faulty three are off back to WD under warranty, I wonder if the fourth will survive? It is certainly not going into any system that is critical.

When the server just stops

Today I rebuilt a PC with new drives and all seemed OK, but after 15 minutes or so it kept stopping (no nice shutdown), irrespective of what the PC was doing. I even swapped back the old disks all to no avail, hence I was stumped for a while.

The problem turned out to be it was a somewhat full case and a wire was stopping the system fan turning, so the CPU was going into thermal shutdown and leaving no event log messages. Also the motherboard was not complaining as the am was still drawing current.

I should have spotted this one earlier, as it has happened before, so it goes on my blog of stupid things you forget to check for!