{ Dev Farm }

Web & Windows Development

17 Dicembre 2013
di max
1 commento

Install 32 bit Websites on Windows 2008 64 bit besides MS Exchange/Outlook

Every time I’m istalling a website on a Win 2008 64 bit server I’ve a lot of problem with MS Exchange and Outlook components. I think this tutorial might save a lot of time to a lot of people!

Event log error message: The Module DLL C:\Windows\system32\RpcProxy\RpcProxy.dll failed to load. The data is the error.
Error message: Could not load file or assembly ‘MMInterfaceVB’ or one of its dependencies. An attempt was made to load a program with an incorrect format.
Error message: The Module DLL ‘C:\Program Files\Microsoft\Exchange Server\ClientAccess\Owa\auth\exppw.dll’ could not be loaded due to a configuration problem. The current configuration only supports loading images built for a x86 processor architecture. The data field contains the error number.
Error message: HTTP Error 500.19 (Module: DynamicCompressionModule)

This error is caused becouse you are loading a 64 bit dll on a 32 bit website.

First of all check your Application pool settings and enable the 32 bit support


This settings It’s going to create other problems, your Aplication pools might be stopping while you open the webpage!


Next step is to disable certain dlls on 32 bit applications


Before starting BACKIP FILES before making changes.

To enable Web Components:

  1. Run the following command with elevated privileges:%windir%\system32\inetsrv\appcmd.exe set config <yoursite>
    -section:system.webServer/httpCompression /-[name=’xpress’]This command disables a compression module which is enabled by default on SBS 2008.
  2. Open a text editor or XML editor with elevated privileges (for instance, from the Start menu right-click Notepad and selectRun as Administrator).In the file %windir%\system32\inetsrv\config\applicationhost.config:
    •  change the line
      <add name=”PasswordExpiryModule” image=”C:\Windows\system32\RpcProxy\RpcProxy.dll” />to the following
      <add name=”PasswordExpiryModule” image=”C:\Windows\system32\RpcProxy\RpcProxy.dll”
      preCondition=”bitness64″ />
  3. If Outlook Web Access is installed on the server, perform the following additional steps.Note that the “path” part of the entries will depend on your local installation and you should not change it. Not all of these entries are present in every installation. You can ignore any entries that are not present.In the file %windir%\system32\inetsrv\config\applicationhost.config:
    •  change the line
      <filter name=”Exchange OWA Cookie Authentication ISAPI Filter”
      path=”C:\Exchange\ClientAccess\owa\auth\owaauth.dll” enabled=”true”  />to the following
      <filter name=”Exchange OWA Cookie Authentication ISAPI Filter”
      path=”C:\Exchange\ClientAccess\owa\auth\owaauth.dll” enabled=”true” preCondition=”bitness64″ />
    • change the line
      <filter name=”Exchange ActiveSync ISAPI Filter”
      path=”C:\Exchange\ClientAccess\sync\bin\AirFilter.dll” enabled=”true”   />to the following
      <filter name=”Exchange ActiveSync ISAPI Filter”
      path=”C:\Exchange\ClientAccess\sync\bin\AirFilter.dll” enabled=”true”
      preCondition=”bitness64″ />
    • change the line
      <add name=”exppw”
      image=”C:\Program Files\Microsoft\Exchange Server\ClientAccess\Owa\auth\exppw.dll”  />to the following
      <add name=”exppw”
      image=”C:\Program Files\Microsoft\Exchange Server\ClientAccess\Owa\auth\exppw.dll”
      preCondition=”bitness64″ />
    • change the line
      <add name=”kerbauth”
      image=”C:\Program Files\Microsoft\Exchange Server\V14\Bin\kerbauth.dll”  />to the following
      <add name=”kerbauth”
      image=”C:\Program Files\Microsoft\Exchange Server\V14\Bin\kerbauth.dll”
      preCondition=”bitness64″ />
    • change the line
      <add name=”exppw” />to the following
      <add name=”exppw” preCondition=”bitness64″ />
  4. If you do not want to require HTTPS (SSL), you may need to use IIS manager to disable this requirement for specific virtual websites or directories.

You may need to recycle application pools and/or restart IIS in order to apply these changes.

The attribute  preCondition=”bitness64″ avoid to load these dlls on 32 bit websites


26 Novembre 2013
di max
0 commenti

Fixing Corrupted applicationHost.config file in IIS 7 and IIS 7.5

Recently one of my clients applicationHost.config files became corrupted, it might my fault because I was editing that file with notepad, and something went wrong.

Anyways IIS7 was erroring out with the error below when I tried to access the websites and application pools. So all websites and web applications were unavailable.

The Windows Process Activation Service encountered an error trying to read configuration data from file ‘\\?\C:\Windows\system32\inetsrv\config\applicationHost.config’, line number ’1′. The error message is: ‘Configuration file is not well-formed XML’

The applicationHost.config is situated on C:\Windows\system32\inetsrv\config\applicationHost.config

To access the history of the applicationHost.config file.

1. Browse to C:\inetpub\history directory
2. Inside this directory you will find a list of folders with the history of all the applicationHost.config file.
3. Pick a applicationHost.config file that you know is not corrupted. I usually pick one a few hours back to be safe.
4. Copy the applicationHost.config file and paste it into the C:\Windows\system32\inetsrv\config directory, replacing the corrupted file.
5. Now attempt to access IIS7 again. This time IIS7 should open, and you should be able to access all your sites and web apps.

23 Luglio 2013
di max
0 commenti

Speed up Entity Framework large data inserting with SqlBulkCopy

As known Entity Framework is quite slow when inserting items and almost unusable when you are insertin 1000+ items.
A very fast workaround is using SqlBulkCopy, it’s very fast and easy to use.

public static void saveData(ref List list, string destinationTableName, int batchSize)
	using (EntityDataReader reader = new EntityDataReader(list))
	using (System.Data.SqlClient.SqlBulkCopy sbc = new System.Data.SqlClient.SqlBulkCopy(PhoneLog.Core.Configurations.ConnectionString))
		for (int i = 0; i < reader.FieldCount; i++)
			string colName = reader.GetName(i);
			sbc.ColumnMappings.Add(colName, colName);
		sbc.BatchSize = batchSize;
		sbc.DestinationTableName = destinationTableName;

In this sample T should be a EntityFramework known object.

12 Luglio 2013
di max
0 commenti

Quick fix for very slow to load “Downloads” folder in Windows 7 & 8

I don’t usually post “tips” but this issue has frustrated me to no end for many months and I finally found a simple but instant effective solution. It’s too good not to spread the word about.

In the last couple of months, I started noticing that clicking the “Downloads” folders in Windows Explorer took around 15-20 seconds to load. This become quite annoying as I frequently access downloaded files from browsers. I tried deleting clearing out the folder but that didn’t have a lasting effect.

After a bit of research, it turns out apparently Windows 7 (and Windows 8) tries to guess-timate what the contents of the folder are and assigns special “rules” to them to optimize the view settings and sorting.

For some reason, the “Downloads” folder likes to be categorized as a “Pictures” folder (I’m guessing because people store a lot of JPGs in it). The problem with this view is that it tries to generate thumbnails for all the files in this folder, even if they’re not pictures.

downloadsfolder downloadfolder-ita

The fix is to ensure the folder settings for “Downloads” is optimized for “General items”. This should have an instant effect (the next time you add files to the folder since the thumbnails are otherwise cached anyway).

Unfortunately, this change doesn’t seem to always stick as Windows may change the option as you download more files, so you may have to check this setting once in a while.