Monday, March 08, 2010

TFS Build error when having a ClickOnce project

We do not have Visual Studio installed on our TFS Build server and it seemed to be failing with the error
The "ResolveKeySource" task failed unexpectedlyerror MSB4018: The "ResolveKeySource" task failed unexpectedly.
error MSB4018: System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
error MSB4018: at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)

According to this blog post on Ed Squared this is due to the fact that the proj requires a certificate if you have a ClickOnce project whose certificate is not imported and it is trying to load up a dialog to ask for it. As the build is non interactive we get the error

Running MSBuild in the project directory which requires this certificate pops the dialog up and if the password is entered it seems to go ahead and do the build for any future requests. But for this to work for TFS the user will have to logon as the TFS Service for it to cache the certificate


Unable to create a constant value of type 'Closure type'

When working with the Entity Framework I got the following error when I was doing a filter

Unable to create a constant value of type 'Closure type'. Only primitive types ('such as Int32, String, and Guid') are supported in this context.

and all I was only doing was a normal Where query with a cast to an int as follows

_entities.Persons.Where(it => it.EmployeeID == (int)EmployeeType.Permanent).ToList();

I decided to move the int cast to a temp variable outside the Where query as the error said that only primitive types were supported and it seemed to work


Tuesday, September 26, 2006

Dual Boot with Monoppix v1.1.8 (Works)

Finally after a lot of playing about I was able to load Monoppix v1.1.8 from my NTFS partition.

You would need to have the following files to achieve this


(google for the above files)

and the menu.lst file which needs to be modified. (My entire menu.lst below)

# GvR Dec 16th 2004
color black/cyan yellow/cyan

title Default Boot on HD 0
rootnoverify (hd0,0)
chainloader +1

# Knoppix Boot from a single NTFS partition hda1:
# All the files within the directory "Root_Of_NTFS" of the
# have to be copied into the root of the NTFS hda1 partition c:# but the boot.ini file (which is just here as an example,
# the line "c:\grldr="GRUB" has been added at the end of the boot.ini)

title Monoppix 1.1.8 kernel 2.4 from NTFS hda1 ISO scan ramdisk=32MB
kernel (hd0,0)/vmlinuz ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=normal nomce quiet fromhd=/dev/hda1/ config=scan home=scan ramdisk=32768 noprompt
initrd (hd0,0)/miniroot_ntfs.gz


All the above files need to be placed on the main partition (C:\ in my case)

You would need to extract the entire Monoppix folder (google for isobuster, this can extract files from iso) and place it on the main partition from where you will be booting (C:\ in my case). You would also need to modify your boot.ini file to allow for grub to be loaded which can then start up the linux kernel.This file is hidden so you would need to do an attrib *.* -h from the cmd window on the C:\ drive to make this visible.
Make a copy of your original boot.ini just in case and add the following line of code to the end of the boot.ini

If you are using a SCSI or SATA hard drive, make sure you make the appropriate changes to the GRUB kernel append lines (ie, changing hda1 to sda1).

Reboot your machine and an option to load grub should come up along with windows, selecting this will give you the Monoppix option select this to start
loading Monoppix

This option works for Knoppix 3.4 or earlier distro's and Monoppix uses Knoppix 3.2

Dual boot Monoppix v1.1.8

I have been trying to dual boot from the Monoppix v.1.1.8 iso but to no avail. Monoppix v1.1.8 is based on Knoppix 3.2 I wonder why such an old version, had it been newer then I guess I would not have had problems booting from the iso. Currently when I try to boot I get the error "Can't find Knoppix filesystem." then it drops me to a "limited shell" with a few command line options.

I found out that after Syslinux starts up the first thing Knoppix wants to do is find and uncompress the filesystem (that big KNOPPIX file on the CD/ISO). Knoppix only probes for the CD on all SCSI and IDE buses. If it can't find then it throws the error above.

Thursday, April 27, 2006

Clearing recent projects list in Visual studio

Visual studio stores the most recently used (MRU's) projects opened int the registry under the path


where Version is the version number of visual studio (e.g VS2005 = 8.0). Clearing this list will reset the values on the start page

Tuesday, April 25, 2006

Clearing the StringBuilder

Its been 4 months now since my last post, I have not been up to much on the development side but here's hoping I get back to my old ways soon.

Right starting off with the StringBuilder, it does not have a clear or reset method to clear the string. I later found out from Brad (Brad Abrams of the BCL team @ Microsoft) that setting the length property to zero clears the string.

Sunday, November 20, 2005

The READY Launch Event

The event went off very well. All the attendees were given vouchers for a complimentary copy of the VS2005 professional edition.I attended 4 Chalk & Talk sessions (previously called Deep Dive)

1. Office Development, Windows Forms and ClickOnce Deployment : Its A Smart Client

2. .NET, SQL and BTS : Application Design Considerations

3. Protect What You Love : Writing Secure Code

4. Visual Studio Team System - Get A Lifecycle

All of them allowed focused on questions put forward by the attendees to the experts.

Also visited the Coding4Fun stand hosted by John Allwright, (John is the Product Manager for Visual Studio here in the UK) and saw the Lego RCX in action.There is going to be an update on the Coding4Fun website regarding the same with the code soon.

It was a great day and there was a lot to learn from the sessions

Tuesday, November 08, 2005

VS 2005 Arriveth

VS 2005 has officially been released on Monday the 7th of November 2005. Contrary to Microsoft's previous statement that it would cost $49 it is now being offered free for one year.After the first year developers would still have a fully functional version with the same license that was granted when it was registered.The express editions can be downloaded from the MSDN web site. Microsoft has also included a lot of freebies with the Express editions and is also allowing the Express editions to be used for Commercial applications.

Thursday, October 27, 2005

The world's best usercontrol

I found this quote somewhere and wanted to share it

"If you ask beginning programmers to write a calendar control, they often think to themselves, 'Oh, I'm going to write the world's best calendar control! It's going to be polymorphic with respect to the kind of calendar. It will have displayers, and mungers, and this, that, and the other.' They need to ship a calendar application in two months. They put all this infrastructure into place in the control, and then spend two days writing a crappy calendar application on top of it. They'll think, 'In the next version of the application, I'm going to do so much more.'
"Once they start thinking about how they're actually going to implement all of these other concretizations of their abstract design, however, it turns out that their design is completely wrong. And now they've painted themself into a corner, and they have to throw the whole thing out. I have seen that over and over. I'm a strong believer in being minimalistic. Unless you actually are going to solve the general problem, don't try and put in place a framework for solving a specific one, because you don't know what that framework should look like."

- August 18, 2003 Anders Hejlsberg (co-creator of Turbo Pascal, Delphi, and C#)

PDC presentations

I know this is a bit late in the coming, but as they say better late than never.
This link lists all the slides and presentations at PDC05