Me, Myself and Mayvelous

Archive for the ‘Bugs and Fixes’ 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.

Whenever we upgrade to a new version of Sitefinity or applying service packs, we get something like the following version conflict errors:

Could not load file or assembly ‘Telerik.Sitefinity, Version=…, Culture=neutral, PublicKeyToken=b28c218413bdf563′

To fix that, place the assembly binding redirect info to the runtime section of your web.config and change the values of the “oldVersion” and “newVersion” acordingly. Your site should work again after a rebuild.

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity name="Telerik.Sitefinity" publicKeyToken="b28c218413bdf563" />
<bindingRedirect oldVersion="4.1.1574.0" newVersion="4.2.1650.0"/>
<assemblyIdentity name="Telerik.Sitefinity.Model" publicKeyToken="b28c218413bdf563" />
<bindingRedirect oldVersion="4.1.1574.0" newVersion="4.2.1650.0"/>

Some of the most recent version numbers I’ve tracked are as followed:

  • Sitefinity 4.0 (4.0.1210.0)
  • Sitefinity 4.1 (4.1.1395.0)
  • Sitefinity 4.1 SP1 (4.1.1405.0)
  • Sitefinity 4.1 SP2 (4.1.1501.0)
  • Sitefinity 4.1 SP3 (4.1.1574.0)
  • Sitefinity 4.2 (4.2.1650.0)
  • Sitefinity 4.2 SP1 (4.2.1733.0)

Another short note/ref to check out is this post on stackoverflow explaining some of the solution to version conflict error:

“Found conflicts between different versions of the same dependent assembly”.

Below is the direct quote from Brian which I find it pretty useful.:

This warning means that two projects reference the same assembly (e.g. System.Windows.Forms) but the two project require different versions. You have a few options:

  1. Recompile all projects to use the same versions (e.g. move all to .Net 3.5). This is the preferred option because all code is running with the versions of dependencies they were compiled with.
  2. Add a binding redirect. This will suppress the warning. However, your .Net 2.0 projects will (at runtime) be bound to the .Net 3.5 versions of dependent assemblies such as System.Windows.Forms. You can quickly add a binding redirect by double-clicking on error in Visual Studio.
  3. Use CopyLocal=true. I’m not sure if this will suppress the warning. It will, like option 2 above, mean that all projects will use the .Net 3.5 version of System.Windows.Forms.

Here is a utility to identify the offending reference(s):

K that’s about it for now.

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.

According to this post, we can reference the Sitefinity built-in script libraries and/or external script files in site master page as followed:

<sf:JsFileLink id="jsLink" runat="server" ScriptType="jQuery"></sf:JsFileLink>
<sf:JsFileLink id="jsLink" runat="server" ScriptType="prototype"></sf:JsFileLink>
<sf:JsFileLink id="jsLink" runat="server" ScriptType="mooTools"></sf:JsFileLink>

To use it, reference the assembly from the project and add the following code in the master page.

<%@ Register Assembly="Telerik.Cms.Web.UI" Namespace="Telerik.Cms.Web.UI" TagPrefix="sf" %>

It didn’t mention which version of Sitefinity it’s used at but after testing, found out that it’s definitly not for our current 4.1 SP2 version. The “JsFileLink” property is for older version of the sitefinity 3.6 etc which comes from Telerik.Cms.Web.UI assembly.

Did a bit more digging around and got the right referencing for 4.1 version.

1. Add this to master page, immediately after Page tag.

<%@ Register TagPrefix="sf" Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI.PublicControls"%>

2. Place the following inside the “form” tag, NOT in the “head” section.

If you have the “JS” folder location as mention in this structure, reference as followed:

<sf:JavaScriptEmbedControl runat="server" ID="jsLink1" ScriptEmbedPosition="Head" Url="~/Sitefinity/WebsiteTemplates/YourSiteTemplates/JS/test.js"></sf:JavaScriptEmbedControl>

If you have the script folder in your website root, use the following:

<sf:JavaScriptEmbedControl runat="server" ID="jsLink2" ScriptEmbedPosition="Head" Url="~/scripts/test.js"></sf:JavaScriptEmbedControl>

For built-in JQuery library, reference as followed:

<sf:JavaScriptEmbedControl runat="server" ID="jQyeryLink" ScriptEmbedPosition="Head" ScriptType="jQuery"></sf:JavaScriptEmbedControl>

3. Must have unique “ID” and specify “ScriptEmbedPosition” fields.

The JavaScriptEmbedControl will register a script in the selected ScriptEmbedPosition (Head, InPlace, BeforeBodyEndTag). This control is also available in the page editor in the Scripts and Styles toolbox section. You can add references to scripts when editing the page through the UI, and even write inline scripts by hand. ref

Place all the external JS link or code blocks at the end of the page rather than the “Head”. ie. use “BeforeBodyEndTag” for some reason sitefinity loads it’s own copy of jquery in the middle of the markup and it tends to mess up the rest of the scripts.

<sf:JavaScriptEmbedControl runat=”server” ID=”jQyeryLink” ScriptEmbedPosition=”BeforeBodyEndTag” Url=”~/scripts/jquery.min.js”></sf:JavaScriptEmbedControl>
<sf:JavaScriptEmbedControl runat=”server” ID=”JavaScriptEmbedControl1″ ScriptEmbedPosition=”BeforeBodyEndTag” Url=”~/scripts/jquery.cycle.all.js”></sf:JavaScriptEmbedControl>

The followings are things to note while create a new sitefinity sites.

Name the solution.
Open the solution via Sitefinity Project Manager and save the solution in the project folder with proper name

Set up DB with appropriate name.
Click “Browse” on the Project Manager to set up the DB.

Add all references as solution items.
Copy all reference DLLs from the bin folder of the project to the “Lib” folder. Add them under solution folder items.

Sitefinity Initial Setup

Repoint/Rereference the dlls from “Lib” folder
Remove all sitefinity related references from the project and rereferences them from the “Lib” folder.
Tip: The easiest way to reference the sitefinity related dlls to the project file would be:
- open the project file in the notepad
- search for “bin\”
- replace the appropriate dll refernces with “..\Lib\”
DO NOT hit “Replace All” as not all places require replacement.
All sitefinity related dlls will be rereferenced to correct folder EXCLUDING AjaxControlToolkit and a few others.
Search for the followings:

..\Reference Assemblies\AjaxControlToolkit.dll
..\Reference Assemblies\Microsoft\WindowsAzure\Microsoft.WindowsAzure.Diagnostics.dll
..\Reference Assemblies\Microsoft\WindowsAzure\Microsoft.WindowsAzure.ServiceRuntime.dll
..\Reference Assemblies\Microsoft\WindowsAzure\Microsoft.WindowsAzure.StorageClient.dll

and repoint to Lib folder as well.
Note: Everytime you do the upgrade or add a custom dlls, make sure to add/update them in the Lib folder and repoint the project references to Lib.

Rename the Assembly and DefaultNameSpace with the project name
Right click on the project > Properties > Application tab > Type in project name in the “Assembly name” and “Default namespace” textboxes.

Rename Assembly

Build the solution
If the aboves are done correctly, your solution will build successfully and once browsed, will display “Thank you for visiting our web site. Please return soon for updates.”
Else you’ll get the error mentioned in the DON’T section below.


Don’t use dots “.” in the project name.
Current version throws error when using dots in the project name.
Don’t build the solution before repointing the references.
After creating a new sitefinity site using Sitefinity Project Manager, do not build the project or solution as it will overwrite the dlls from the bin folder and throw the following error.
_”Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.”_ Ref

I was trying to deploy a .NET 2.0 application using ClickOnce Deployment the other day.
I had all the IIS settings configured and folder paths entered correctly.
When I clicked ‘Publish Now’, I got an error message that made me wonder if I needed to reinstall Visual Studio.

Cannot publish because a project failed to build.
Could not find required file ‘setup.bin’ in ‘C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Engine’.

Publishing ClickOnce Deployment

My first reaction was oh damn, I don’t want to reinstall whatever it is that’s broken.
My second smarter reaction was to google the error :)
Found this post on MSDN forums.

Basically, it was AVG Antivirus 8.0 that incorrectly identified and quarantined a required file as a Trojan.
AVG Free marked the file C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Engine\setup.bin as a Trojan horse BackDoor.VB.DIY

AVG Free Virus Vault

Simply select the file and click the ‘Restore’ button from AVG’s Virus Vault. (So glad I havn’t been emptying my vault!)

Once that little error was corrected, it was a simple matter to click ‘Publish Now’ again and I was happily on my way to my first ever ClickOnce Deployment!
I’m glad it wasn’t a serious problem requiring reinstalls.

Some days, I wonder if I want to keep an antivirus program running on my computer.
I don’t need much protection as I am careful in my mail box and I rarely visit websites out of google’s domain.
Google Reader gets me everything I want to read anyway.
Scratch that thought I lend my flash drive out to other people sometimes so it wouldn’t be a good idea to have no protection.
I trust myself but you just can’t trust people’s machines.

I have reinstalled Visual Studio.Net 2003 just to work with some of the old .net 1.1 projects. This one project uses infragistics web components and I’m getting the error on those pages with infragistics controls.

Program Version:

# Infragistics NetAdvantage 2005 Volume2 + hotfixes
# Visual Studio.Net 2003
# Windows Vista Ultimate


I have my project with valid references, building and running fine except while browsing to those pages with any reference to infragistics components I’m getting the compilation error as mentioned below.


Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30009: Reference required to assembly ‘Infragistics.WebUI.Shared.v5.2′ containing the implemented interface ‘Infragistics.WebUI.Design.IGetClientSideEvents’. Add one to your project.
Line 1: <%@ Register TagPrefix="igsch" Namespace="Infragistics.WebUI.WebSchedule" Assembly="Infragistics.WebUI.WebDateChooser.v5.2, Version=5.2.20052.1039, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" %>


In order to run applications that use the Infragistics Web Controls on your machine, you will need to set the Copy Local flag to True for the Infragistics.WebUI.Shared.dll Assembly. This is because that assembly is registered into the Global Assembly Cache by the Windows Forms products, but ASP.NET Web Applications, by default, do not look in the GAC to resolve assembly references at runtime. Therefore, the Infragistics.WebUI.Shared assembly must be copied to the local project directory in order to run the Web application under IIS.

#Knowledge Base Article: KB01932
# More detail explanations: Whats the deal with Infragistics.WebUI.Shared.dll and the CopyLocal property?

If you don’t want to make Infragistics.WebUI.Shared.dll copylocal property to true then, add the dll file in the bin folder and refresh your page, it will work but better to make CopyLocal property to true.

  • Comments Off
  • Filed under:, Bugs and Fixes, Infragistics
  • Flickr Photos


    Twitter Status

    Goodie Links

    Mayvelous Friends

    I'm an Author for Global Voices