# Wednesday, 05 October 2011

Visual Studio 2010: Debugging a x86 WCF service on a x64 machine

I just ran into an issue where I have a WCF service that depends on a .NET assembly that is compiled specifically for x86. In order to use that assembly I need to compile the service as a x86 service. No problem, but now when I want to test or add a service reference to this WCF service I ran into the problem that WcfSvcHost and WcfTestClient both will run a x64 because I’m running Windows 7 x64.

How to solve this? I found the answer in the forums and adapted the answer for my specific problem:

1.Copy WcfSvcHost.exe and WcfTestClient.exe from C:\program files (x86)\Microsoft Visual Studio 10.0\Common7\IDE to a local directory. Keep a backup copy of this file, of course.
2.Start a Visual Studio 2010 Command Prompt (one of the links from the start menu -> Visaul Studio 2010)
3."cd" to the directory where your copy of WcfSvcHost is located.
4.Execute the command "corflags /32BIT+ /FORCE WcfSvcHost.exe"
5.Copy the files back to where you found it.
 
Now your WcfSvcHost and WcfTestClient will be running in 32 bit mode.

#    Comments [3] |
# Wednesday, 29 December 2010

IE9 and VS2010 debugging issue (DNS error)

Etienne Trembley found the solution to a problem that’s been haunting me since I installed IE9 beta. As it turns out IE9 prefers IPv6 over IPv4 AND on a Windows 7 64bit machine the hosts file (in c:\windows\system32\drivers\etc) does not provide an IPV4 entry to make localhost look at 127.0.0.1. Adding the localhost entry in the host file solves the issues!

Read the full post here: http://geekswithblogs.net/etiennetremblay/archive/2010/10/07/ie-9-cassini-and-the-dreaded-dns-error-or-page.aspx

#    Comments [0] |
# Monday, 10 May 2010

Error installing SQL Server 2008 R2

I just tried installing SQL Server 2008 R2 in a VirtualPC environment. This caused an error, redownloading the .iso image from MSDN did not help. I Binged it and found Bob Beauchmin had the same problem. Apparently the .iso reader in VirtualPC causes the problem.

More here: http://www.sqlskills.com/BLOGS/BOBB/post/Getting-error-2337-installing-SQL-Server-on-a-VPC.aspx

#    Comments [0] |
# Wednesday, 10 March 2010

Reading Excel files in a WCF service using OleDB requires 32bit process

I’ve been doing a little work on a WCF service that reads an Excel file. My development machine is running Windows 7 64bit and my service was deployed to IIS. I kept running into a problem with opening the OleDb connection to the Excel file: “Error: Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine.”

Turns out that Office Jet provider will only run in 32bit. After changing my ASP.NET processes to run in 32bit everything ran just fine.

This KB article shows how to change ASP.NET to 32bit: http://support.microsoft.com/kb/894435/en-us

#    Comments [2] |
# Tuesday, 09 February 2010

Using Windows 7 Search to delete ‘obj’ folders

Visual Studio will create ‘obj’ folders within your solution to store a bunch of temporary files. You can remove these files in a number of ways.
One easy way is to use Windows 7 Search to look for all the ‘obj’ folders and just delete them manually.
To do this I use the ‘kind’ keyword in the query box.

 image

Tip: Just typing ‘kind:’ will give you a list of choices to choose from.

For a complete overview of the Windows 7 Search syntax go to: http://www.microsoft.com/windows/products/winfamily/desktopsearch/technicalresources/advquery.mspx

#    Comments [0] |
# Tuesday, 10 November 2009

Fix Outlook PDF preview on Windows 7 64bit.

When moving to Windows 7 I also moved from 32bit to a 64bit operating system. The experience has been great, but PDF previews in Outlook 2007 weren’t working anymore. Bink.nu has the solution:
http://bink.nu/news/fix-adobe-pdf-preview-handler-on-64-bit-windows.aspx

#    Comments [0] |
# Sunday, 18 October 2009

Windows 7 resources for developers

Jim O’Neil has a great post with a list of links to resources that are useful for developers targeting Windows 7.

Go here: http://blogs.msdn.com/jimoneil/archive/2009/10/17/code-camp-12-7-on-7-resources.aspx

#    Comments [0] |
# Sunday, 11 October 2009

Unblocking assemblies in Windows 7

I just ran into a little problem when attempting to run a Visual Studio unit test on my Windows 7 machine. I downloaded log4net.dll and wanted to use it in a project, but when running the unit test I ran into the following error:

Failed to queue test run 'Mark@L-ONE 2009-10-11 14:08:38': Test Run deployment issue: The location of the file or directory 'c:\users\mark\documents\visual studio 2008\projects\sources\developone.myproject.unittests\bin\debug\log4net.dll' is not trusted.

Turns out that a downloaded file is blocked. You can unblock the file by right clicking the file and choosing “Unblock”.

image

Make sure you remove all copies of the assembly (if you have copy local = true) and then recompile.

#    Comments [0] |