Friday 12 December 2008

Package Load Failure Microsoft.VisualStudio.Xaml

Few days ago all of the sudden VisualSudio 2008 popped out this error message "Package Load Failure Microsoft.VisualStudio.Xaml blah blah yes/no" I didn't pay much attention to it (because it was yes/no message box and in that case i always click yes :)) After that Visual Studio didn't load 2 of 5 C# projects in my solution complaining that project type is not supported by current installation. Of course i was baffled because I din't connect error message to this problem right away. Apparently by clicking Yes I've disabled Visual Studio package (because it failed to load obviously). OK, no problem devenv /reset will fix this right? Wrong! Visual Studio tries to load Microsoft.VisualStudio.Xaml but fails for no apparent reason. I've googled up bunch of "fixes" for this problem but none of devenv switches or even Visual Studio Repair works. So this is what worked for me:

Uninstall Visual Studio
Install Visual Studio
Apply Visual Studio SP1

I hope this helps.

Cheers!

Tuesday 4 November 2008

Did you hear?

Visual Studio 2010 CTP is out!!! Can't wait to check it out!

Friday 17 October 2008

My fist Open Source Project - OfficePackage

Today I've started my first Open Source project!!! The project is called OfficePackage and it can be found here http://www.codeplex.com/OfficePackage It's my project exactly, it's based on ExcelPackage. OfficePackage goal is to create a library for creating/editing OOXML (aka Office 2007) documents from .NET. At his point OfficePackage has limited implementation of creating/editing Excel 2007 documents. Anyone willing to contribute please drop me an email. Cheers!

Thursday 2 October 2008

Another LINQ bug: DataContext.GetCommand throws InvalidCastException

Today I've found yet another LINQ bug :( Couldn't find solution on google so I've submitted bug to Microsoft. Bug report can be found here. Waiting for reply from MS...

Tuesday 19 August 2008

Frustrating .NET Framework SP1 Bootstrapper Issue

If you'll try to bootstrap your project with .NET Framework 3.5 SP1 you'll get the following error:

error MSB3152: The install location for prerequisites has not been set to 'component vendor's web site' and the file 'DotNetFX35SP1\dotNetFX20 aspnet.msp ' in item '.NET Framework 3.5 SP1' can not be located on disk. See Help for more information.


This because MS guys forgot to make correct bootstrapper package. Solution is posted here

And the solution itself:

Update the Package Data

1. Open the [Program Files]\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1 folder or %ProgramFiles(x86)%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1 on x64 operating systems
2. Edit the Product.xml file in Notepad.
3. Paste the following into the < PackageFiles > element:
< PackageFile Name="TOOLS\clwireg.exe" />
< PackageFile Name="TOOLS\clwireg_x64.exe" />
< PackageFile Name="TOOLS\clwireg_ia64.exe" />


Download and Extract the Core Installation Files

1. Navigate to the following URL: http://go.microsoft.com/fwlink?LinkID=118080
2. Download the dotNetFx35.exe file to your local disk.
3. Open a Command Prompt window and change to the directory to which you downloaded dotNetFx35.exe.
4. At the command prompt, type:
dotNetFx35.exe /x:.
This will extract the Framework files to a folder named “WCU” in the current directory.
5. Copy the contents of the WCU\dotNetFramework folder and paste them in the %Program Files%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1 folder (%ProgramFiles(x86)%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFx35SP1 on x64 operating systems). Note: Do not copy the WCU\dotNetFramework folder itself. There should be 5 folders under the WCU folder, and each of these should now appear in the DotNetFx35SP1 folder. The folder structure should resemble the following:
o DotNetFx35SP1 (folder)
* dotNetFX20 (folder
* dotNetFX30 (folder)
* dotNetFX35 (folder)
* dotNetMSP (folder)
* TOOLS folder)
* en (or some other localized folder)
* dotNetFx35setup.exe (file)

You may now delete the files and folders you downloaded and extracted in steps 2 and 4.

Wednesday 16 July 2008

Solution to -2147467259: failed to create SQL database

This one haunted my for weeks! I'm using WIX 3.0 as my app installer. During install i create a SQL database and run a SQL script. Everything seemed but on computers SQL Express database creation failed with
-2147467259: failed to create SQL database
After days of hacking I finally found the solution! All you need to do is use .\sqlexpress instead of localhost\sqlexpress or 127.0.0.1\sqlexpress in your connection string. I think (and I might be terribly wrong here) when you use .\sqlexpress in connection string installer uses Shared Memory instead of Named Pipes or TCP/IP.

Sunday 8 June 2008

Binging to User Settings in WPF

Recently I've been having this programming issue. I need to solve programming problems that I've solved before, but i just can't remember how exactly i did it. This irritates the hell out of me. So what i try to do is trace back my steps, try to remember keywords that I've used to find solution the first time. Google Web History helps sometimes, but this is definitely wrong way to go about it. So i figured I'll just blog solutions to my programming problems and then everybody will be happy :). The next time I need to refresh my memory I'll just have to check my blog. Haha! Perfect!

Okay so on to today's issue, this is an easy one. WPF Binding to User Settings. Just set Binding Source to x:Static Properties:Settings.Default and binding path to settings name like this:


Thursday 3 April 2008

Encrypting RAID0 swap

In my previous blog post I've talked about how to setup encrypted system though i skipped the part on how to encrypt swap. So here it is now.

As you remember we left /dev/md1 reserved for swap now it's time to use it:
sudo cryptsetup create swap /dev/md1
and add this line to your /etc/crypttab
swap        /dev/md1    /dev/urandom swap
since i don't want to enter pass phrase for swap partition I'm going to use new key on each boot. Setting key file to /dev/urandom does exactly that. That's it now reboot your system or simply
swapon -a
sudo swapon /dev/mapper/swap

Cheers!

Thursday 27 March 2008

Setting up encrypted RAID0 in Ubuntu 7.10 (Gutsy Gibbon)

Nowadays you never know when police will burst in into your home and confiscate your computer. And who knows that kinds of sensitive data you might have. No Unix password protection is going to help you in this case, what you need is hard drive encryption. Since hard drives are cheap and RAID really boost hard drive performance we are going to encrypt RAID device.

For this setup you'll need
  • 2 or more hard drives (preferably identical)
  • Gutsy Gibbon alternate CD
Start of like your normal install
Continue until you reach Disk Partitioning. Select manual partition method.

Create 3 RAID devices. One for boot, one for swap and ONE for all other stuff (root, home, etc...) Note we'll setup encrypted swap after installation because there's bug in Gutsy installation. For now just create RAID0 device for swap but don't use it just yet.
My setup looks like this


~ 100MB for boot (md0), 1GB for swap (md1) and 3.1 GB for everything else (md2) (in a real system you should use remaining disk space for the last RAID device)

Hit Enter on md2 and select use as "physical volume for encryption". Make sure you that "Erase data" is set to "no" because this will take hours to complete and is not really necessary unless you expect cryptographic attacks on your system in the near future. I chose AES encryption with 256 bit key.

The design and strength of all key lengths of the AES algorithm (i.e., 128, 192 and 256) are sufficient to protect classified information up to the SECRET level. TOP SECRET information will require use of either
the 192 or 256 key lengths

Back in partition manager you'll see a new choice "configure encrypted volume". This will create a new encrypted device (md2_crypt in my case). In this device create your root and home partitions.


You should end up with /boot on md0, md1 reserved for swap (not in use yet) and both root and /home on md2_crypt. Now proceed with install until reboot is requested. Do NOT reboot your system! Hit ALT + F2 and followed by Enter. You should now be in busybox shell. Now you need to edit /target/etc/crypttab.

nano /target/etc/crypttab
enter the following (change to your corresponding md device)
md2_crypt     /dev/md2    none luks
Then execute
chroot /target /bin/bash
mount /proc
update-initramfs -u
umount /proc
Now you can switch back to install screen ALT + F1 and reboot. During boot you'll be prompted for your passphrase. Congratulations you've booted into encrypted system. With no swap though I'll cover that in my next blog post.

Tuesday 29 January 2008

Syntax highlighting

Finally got my syntax highlighting working. Unfortunately blogger doesn't support syntax highlighting by itself you have to do a bit of hacking. So after hours of browsing I've stumbled uppon this.
Here's the result:
class MyClass
{
private int myInteger;
}

By the way, for some reason syntax highlighting is only visible after publishing the post. Took me half and hour to figure this one out :)