mayvelous

Me, Myself and Mayvelous

Archive for the ‘Project Notes’ Category

The following things to note when you deploy a new Sitefinity site to production environment:

  1. Check the site authentication mode. It must have only one authentication. Check “Anonymous” and un-check “Integrated windows”
  2. Check Theme style link binding. Sometimes you need to add aspnet_isapi.dll wildcard in order to make the theme work again.
    IIS > Website > Properties > Home directory tab > Configuration > Wildcard application maps > Add (C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll)
    Make sure to UNCHECK “Verify that file exists” or you will have 404 errors everywhere.
  3. Check if your server have all required MIME types eg. Silverlight MIMEs
  4. Give the website folder “ASPNET” and “NETWORK SERVICE” WRITE access
  5. Reindex all your search indexes.
  6. Update your license file to correct site domain license

… will add more as I find things later.

  • Comments Off
  • Filed under: .Net, Asp.net, Development, My To-Do List, Notes, Project Notes, Work
  • 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.

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

    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):
    http://www.brianlow.com/index.php/2010/01/25/find-conflicting-assembly-references/

    K that’s about it for now.

    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

    IMPORTANT
    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.
    eg.

    <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

    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 learn something new today (I’m sure most of you already know, but I just found out). I didn’t know we can use html tags such as div, span etc as html server controls. I do know if you want to convert html controls into server control, you just have to add runat=”server” element but using div container as server control is a different story.

    I normally use literal or panel server controls to show or hide the confirmation messages. But in this code, the div tag can act as a panel control by declaring it as HtmlGenericControl.

    In the front-end you add id and runat=”server” elements to the div tag.

    <fieldset>
    	<h3>Registration Validation</h3>
    	<div id="divValidated" runat="server">
    		Your account has been validated. You may now log in.
    	</div>
    	<div id="divNoAccount" runat="server">
    		No matching account. If it has been over 30 days since you registered your
    		account will have been deleted. Please sign up again.
    	</div>
    	<div id="divNoNeed" runat="server">
    		Your account has already been validated.
    	</div>
    </fieldset>
    

    In the back-end you declare it as HtmlGenericControl.

    protected System.Web.UI.HtmlControls.HtmlGenericControl divValidated;
    protected System.Web.UI.HtmlControls.HtmlGenericControl divNoAccount;
    protected System.Web.UI.HtmlControls.HtmlGenericControl divNoNeed;
    

    Voila, you got your div panel with all those member variables you can make use of. So here is a little info on HtmlGenericControl.

    Use this class to represent an HTML server control element not directly represented by a .NET Framework class, such as <span>, <div>, <body>, or <font>.
    Caution
    This control can be used to display user input, which might include malicious client script. Check any information that is sent from a client for executable script, SQL statements, or other code before displaying it in your application. ASP.NET provides an input request validation feature to block script and HTML in user input. Validation server controls are also provided to assess user input.
    HtmlGenericControl Class
    HtmlGenericControl Members

    Pretty cool isn’t it? Well, I didn’t know that and now I know. :D

    Just Bitching

    I have never encountered this much pain in the arse customer than the current one before.

    I’ve done twice/thrice more complicated and bigger projects than this project in the past but never ever had this much of discussions, arguments, back and forth explanations and long meetings after meetings with the customer before.

    I grew a few white hairs after handling this project and going to grow some more since the project is no near to the closing stage.

    I thought I’m 90% done after sending out the last build and the user manual. I’m only expecting minor bug fixes but NOOOOOOOO he just has to go change the whole damn lot and have to fix almost everything from the DB schema to almost every form.

    It’s all because of this F*ed up requirement spec and F*ed up customer to start with. I need a bad ass project manager to handle this kind of bad ass customer. Unfortunately, there is no proper project manager was assigned to this project, thinking it’s going to be a small one. I know I should
    turn myself into a bad ass bitch to take matters into my own hand but the problem is I can’t become the bad ass bitch; I don’t know how.

    It’s not that easy to become a good “bad ass bitch” when you’re trying to become one. You need certain skill in that area as well. I’m terrible in that area. The most I can do is I start raising my voice and become angrier but there is no art/tactic in it.

    My main problem is that the angrier I am, the quieter I become. I’ll just yell back a few words then I won’t talk anymore. I got mess up in the head that I can no longer put those mess into proper word. I need some trained/naturally talented bad arses to back me up with the arguments. I think I need to go take a course on the art of bitching. Let me know if anyone providing one.

    Anyways, my boss is just so nice dealing with customers. He accepts anything if they pay for it. Ok, it’s actually a good thing if they pay for it but what if they don’t pay and just keep bullying me and dragging the project on and on?

    There should be a time when we say, “That’s it, no more, we are done, no nil nada F* off!”, and close the damn project.

    Anyways, I’ll have to do more analysis and effort sizing on the new changes. I’ll bitch more about it later. Bye!

    Licenses.licx and VSS

    In our current project, we have to work with WinForms using VS 2005 and VSS as the project source control. There are two solid developers and one developer/Product Manager involved in the coding of this project. Our Product Manager suggests and prefers we use VSS rather than SVN for better source management (check in/out). As for us, developers (me and my bro), we had a great time using SVN in the last project and prefer to use SVN; nevertheless both of us are flexible and agreed to work with VSS after a few discussion. Things are fine when I focus on designing forms and my bro working on code behinds. But the problem arises when we start testing on a few forms, which need both of us to work on design view.

    In VS2005 WinForm IDE, it adds or writes to the licenses.licx file whenever you use custom controls/third party controls such as Infragistic in your form. Though I’m not so sure, I observe that the licenses.licx file is not needed if you work entirely with normal winform controls, but with third party controls, it acts as a config file storing the references of the controls.

    Once you add a project to VSS DB, the licenses.licx file is always binded since it’s part of the project property. You can check out the code just fine but when you work with the form design, you’re forced to check out the licenses file. If you don’t/can’t check it out, you can’t do anything to the form design. With VSS, it’s really a pain if one developer checked out the licenses file exclusively, others can’t do any design work on any of the forms. To solve the exclusive checkout on licenses file, we tried to exclude the licenses.licx from the project and let it stay in local folder. Unfortunately, the file itself is part of project property and once it’s excluded, it loses the references as well. For that little experiment, I’ve lost two of my form designs and have to start all over; thank god, they were just small forms. With that failed experiment and out of ideas, we searched for the solution on the web. Found out that it was a known issue for VS2005 IDE and the fix would only available with the next release of Visual Studio. The only work around they suggest so far is to use VSS multiple check out mode.

    We don’t want to use Multiple check out mode in our VSS DB for:

    1. VSS doesn’t provide individual file multiple check out mode but for the whole DB,
    2. There are a few careful steps to take before checking back in the multiple check out file. (You cannot check in directly. You must get latest on that file to ensure you get different versions from other developers to merge the file then only you can successfully check it back in.)
    3. VSS merge is a real pain and should I would never trust it. Unless ofcos’ you don’t care about losing some of your codes or have a separate backup, go a head and try it out.
    4. There is the need of source control administrator for merging files.
    5. And again, don’t trust VSS Merge and can’t rely on it.

    But untill the next VS release, it’s the only possible way so we don’t have a choice but to use that method. Don’t have time to dig up properly either. So gonna stuck with this problem for the whole project. It’s just making my life miserable. *sign*

    Readings: MS Feedback | Forum Q&A

    Flickr Photos

    Downloads

    Twitter Status


    Goodie Links


    Mayvelous Friends


    I'm an Author for Global Voices

    Archives