Me, Myself and Mayvelous

Archive for the ‘Visual Studio’ Category

I deployed the Sitefinity site from local to DEV and STAGING servers and the document uploader works on DEV but suddendly disappear on the STAGING server.

Correct Screen
correct screen

Error Screen
blank document upload

I’ve created a forum post but received no good answers. The dude kept asking me to install Silverlight Tools on all the machines. I don’t understand why we have to install silverlight on all machines and which silverlight exactly to install as there’re browser plugin, silverlight tools, silverlight framwork etc. And I cannot install silverlight tools unless the prerequisites, Visual Studio 2010 and Web Developer Express 2010, been installed which I absolutely don’t want to do. Also on the DEV server, there’s not a single instance of Silverlight installation was there and the uploader’s working just fine so I really had a hard time figuring out the issue with STAGING site. The forum responds were so slow, so I created a ticket and the same dude replied as followed:

Can you enable Firebug and check what errors come up in the Net tab when you try to access the Upload section? Also is there a way to provide RDC to your server so I can inspect the settings in more depth?

Ofcos I don’t want to give RDC access but I checked the Firebug and that really helps figure out the problem.
With the help of Firebug, I got 404 file not found for Telerik.Sitefinity.Silverlight.xap file with the error below:

Unhandled Error in Silverlight Application
Code: 2104
Category: InitializeError
Message: 2104 An error has occurred.

Now that’s some good hint, so I checked the path and the file exists on the server so must be the file permission issue; I googled the error message and found out that it’s all to do with missing MIME Types on STAGING server.

mime types

I’ve added these 3 types to the server MIME types list and it fixes the problem.

.xap application/x-silverlight-app
.xaml application/xaml+xml
.xbap application/x-ms-xbap
Ref: Configuration IIS for Silverlight Applications

I wasn’t happy with the support but thank god he at least gave me a hint to check with Firebug.

I have this project setup for continuous integration with cruise control. It’s been up and running for quite sometime then suddenly the website starts getting the following errors on every successful build.

Exception Details: System.BadImageFormatException: Could not load file or assembly ‘Microsoft.VisualBasic.Activities.Compiler’ or one of its dependencies. An attempt was made to load a program with an incorrect format.

The Error Page
Solution/Project Platform Target Configuration + Cruise Build

I did not make any changes to the build configs at all and the site runs fine locally. There is no reference to ‘Microsoft.VisualBasic.Activities.Compiler‘ in my project and it doesn’t have VB code. I found some extra files, see below list, in the deployment bin while comparing the bin assemblies on deployment server and my local. Once remove those files, the site comes back on, but the files are added with every cruise build.

  • Microsoft.VisualBasic.Activities.Compiler.dll
  • Microsoft.Practices.ServiceLocation.dll
  • Microsoft.Practices.ServiceLocation.xml
  • mscorlib.dll
  • normidna.nlp
  • normnfc.nlp
  • normnfd.nlp
  • normnfkc.nlp
  • normnfkd.nlp
  • PresentationCore.dll
  • System.Data.dll
  • System.Data.OracleClient.dll
  • System.EnterpriseServices.dll
  • System.EnterpriseServices.Wrapper.dll
  • System.Printing.dll
  • System.Transactions.dll

I google a bit to check similar problems out there and found only one link, which was fixed by installing missing SDK or something. I didn’t think that was the right solution for me but got an idea to check for target platform configuration on the solution and project files.

I compare with one of my working project many times using visual studio property window to check for the solution and project file configuration properties but they seemed to be the same, using ANYCPU for the build platform. I didn’t trust the VS property designer so used WinMerge to compare the two files and found that there are some additional configuration lines added to the solution file. So I open the .sln and .csproj in notepad, removed all the extra configs, see the image below, checked back in, forced build the Cruise Control and walah all those craps gone and the site is back to the way it was.

.sln Solution file comparison and the lines to remove
Solution/Project Platform Target Configuration + Cruise Build

.csproj Project file comparison and the line to remove
Solution/Project Platform Target Configuration + Cruise Build

The point I like to make here is that although no error with cruise build, your site can still be broken and freaking Visual Studio design views lie many time so remember to go for the good old way of editing it in notepad.

Note: If you don’t have any working version to compare, just search for “Mixed Platforms” or “x86” in .sln file and “<PlatformTarget>AnyCPU</PlatformTarget>” in .csproj file and remove them accordingly.

Flickr Photos


Twitter Status

Goodie Links

Mayvelous Friends

I'm an Author for Global Voices