Tuesday, February 21, 2012

Consuming XML-RPC web services with C# - Part 3 - let others do the work

At Part 1 and Part 2 I have shown the raw way and the object oriented approach to consume xml-rpc web services.

This time, we take a look at a helper to simplify the process of developing and consuming XML-RPC web services.

Tuesday, June 14, 2011

Localizing Windows Phone 7 ApplicationBar

In order to provide a seamless user experience on your Windows Phone 7 you also have to localize the ApplicationBar within your app.

First, you will encounter that the ApplicationBar on the Microsoft.Phone.Shell namespace is not an usual UIElement and therefore can not be named via
x:name
The second thing you will recognize is that the ApplicationBar property of an PhoneApplicationPage is not initialized due the usual InitializeComponent method.

On my search over the internet I spotted some suggested hints, but often the solution is obvious.

Localizing Silverlight toolkit for Windows Phone 7

Due my localization adventures of my apps for Windows Phone 7 I spotted out an library to get the toolkit for Silverlight localized.

You could do this easily by yourself but Peter Foot already provides a zip with needed resource files. It's available on Localised Resources for Silverlight Toolkit Nov 2010

Thursday, January 20, 2011

Determine Win7 version on install DVD

I recently faced the question on how to determine the version of an given blank Windows 7 DVD.

After some web search and I had tried several ways here’s how you do this.

Wednesday, November 24, 2010

Store data from async web service call with Silverlight

Did you ever tried to store data on Silverlight from an async web service call using SaveFileDialog - and get told it doesn’t work?
But that is only half the truth. Here it how it works!

Monday, November 1, 2010

Visual Studio, TFS and WinMerge

WinMerge is a great and handy tool for comparing and merging source code and other textual file types within a team development environment.

I use it since a few years and therefore I also want to use it with VS2010 and TFS and it’s very simple.

Just go through

Tools > Options > Source Control > Visual Studio Team Foundation Server > Hit <Configure Tools>

Here you can setup custom tools for comparing and merging.

Add a new tool and provide the installation path to WinMerge and some command line arguments like (explanation follows):

Zwischenablage01

Hit <OK> and do the same with merge.

Command line switches for WinMerge are (copied from the WinMerge documentation):

  • /r compares all files in all subfolders (recursive compare).

  • /e enables you to close WinMerge with a single Esc key press.

  • /f applies a specified filter to restrict the comparison. The filter can be a filemask or the name of a file filter

  • /x closes WinMerge (after displaying an information dialog) when you start a comparison of identical files.

  • /s limits WinMerge windows to a single instance.

  • /ul prevents WinMerge from adding the left path to the Most Recently Used (MRU) list.

  • /ur prevents WinMerge from adding the right path to the Most Recently Used (MRU) list.

  • /u prevents WinMerge from adding either path (left or right) to the Most Recently Used (MRU) list.

  • /wl opens the left side as read-only.

  • /wr opens the right side as read-only.

  • /minimize starts WinMerge as a minimized window.

  • /maximize starts WinMerge as a maximized window.

  • /dl specifies a description in the left side title bar, overriding the default folder or filename text.

  • /dr specifies a description in the right side title bar, just like /dl.

  • leftpath specifies the folder, file or project file to open on the left side.

  • rightpath specifies the folder, file or project file to open on the right side.

  • outputpath Specifies an optional output folder where you want merged result files to be saved.

  • conflictfile Specifies a conflict file, typically generated by a Version control system.

Resources:
flurfunk.sdx-ag.de
www.prowebconsult.com
Winmerge manual

Sunday, October 31, 2010

Auto checkout with VS2010 and TFS2010 not working

On my project “Simple Proxy Switch” I decided to access codeplex version control system through VS2010 TFS integration.

As I mainly use Subversion I like that you can edit files without locking them. As I arrived on TFS I missed this a lot. Searching for other options I found the ability of TFS to check out files on edit.

image

Nevertheless it doesn’t work for me. Files still are not getting checked out on edit.

Fast search at the web discovers some helpful links mainly again in the Microsoft Developer Network.

The missing setting was the binding of the solution to TFS. This can be achieved on Selecting solution and than go through

File –> Source Control –> Change Source Control

select solution and hit <Bind>.

Et voilĂ . Now VS2010 checks out files on edit.

Thursday, October 21, 2010

You are logged into a Temporary Profile

Shortly my new syspreppted virtual machine say’s “You are logged into a temporary profile.” WFT?

After a short search with my search engine of choice I found a solution for this on the Windows 7 IT Pro Forums. Detailed information about user profiles can be found on About User Profiles.

So this has been caused because I used this machine with the same domain account before I had sysprepped it.

In short:
Search user profile at
C:\Users\%username%
and delete it.
Open the registry editor and search for the profile with the corresponding SID at registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\ProfileList
and delete it.

Restart and try to log on. Problem should be solved.

Detect current network setting with C#

In cause of my latest project Simple Proxy Switch I had to face the challenge of detecting the setting of the current network the computer is connected to.

Now here’s my snippet how do I retrieve the current network setting:

// zero conf ip address
IPAddress zeroConf = new IPAddress(0);
// get current assigned addresses
IPAddress[] hostAddresses = Dns.GetHostAddresses(Dns.GetHostName());

var networkData = NetworkInterface.GetAllNetworkInterfaces()
  // filter running network interfaces
  .Where(network => network.OperationalStatus == OperationalStatus.Up)
  // filter unknown interfaces
  .Where(network => network.NetworkInterfaceType != NetworkInterfaceType.Unknown)
  // filter loopback interfaces
  .Where(network => network.NetworkInterfaceType != NetworkInterfaceType.Loopback)
  // get the properties
  .Select(network => network.GetIPProperties())
  // filter initialized gateways
  .Where(ipProps => ipProps.GatewayAddresses.All(gateway => gateway.Address != zeroConf))
  // filter and get ip addresses
  .SelectMany(ipProps => ipProps.UnicastAddresses.Where(ucAddress => hostAddresses.Contains(ucAddress.Address)))
  .Where(ucAddress => hostAddresses.Contains(ucAddress.Address))
  // simply use the first
  .FirstOrDefault();

Be the force with you!

Monday, September 27, 2010

Network drives unavailable while running programs under Admin privileges

Since the installation of VS 2010 I discovered that some network shares are unavailable to access with Visual Studio 2010. This is disturbing because my shared settings living on a network share.
I guessed this was caused because of VS2010
%VSINSTALLDIR%\Common7\IDE\devenv.exe
is treated to be executed as administrator also the VSLauncer.exe located in
%CommonProgramFiles%\microsoft shared\MSEnv\VSLauncher.exe
Yesterday I spent now 2 min with google and found a solution.
The problem is caused by using different access tokens for user currently logged in and program that runs with admin privileges. Further information can be found here.
This problem can be solved by enable sharing of access tokens between current (filtered) and admin access. This can be done by creating registry key
EnableLinkedConnections
located under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
and setting it’s DWORD value to ‘1’. Detailed information can be found here.

Have fun.