mayvelous

Me, Myself and Mayvelous

Archive for the ‘Asp.net’ 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
  • 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.

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

    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

    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

    Problem:

    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.

    Error:

    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" %>

    Solution:

    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.

    References:
    #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: Asp.net, Bugs and Fixes, Infragistics
  • I’m wondering – asp.net 2.0

    I’m wondering…

    • I’m wondering, asp.net 2.0 website project does not create project file and .dll file and where all those code-behinds compiled into?
    • I’m wondering, if we are to deploy it, do we only deploy .aspx and .ascx (front-end) files or have to include code-behind files as well?
    • I’m wondering, why .pdb files are also included when you add project references to the website project.
    • I’m wondering, why some referenced .dll creates .xml files as well.
    • I’m wondering, do we need to add those .pdb and .xml along with referenced .dll in the deployment.
    • I’m wondering, the main difference between asp.net 2.0 web application project and web site project.

    And I’m still wondering…

    LLBLGen vs CodeSmith

    Comparison between LLBLGen Pro and CodeSmith tools. I’m very new to both so the following points might be completely wrong. So correct me please and do fill in more.

    LLBLGen CodeSmith
    O/R Mapper + Code Generator Template based Code Generator
    Uses Parameterized Dynamic Queries Mainly Stored procedures
    Cost license fee,
    Need to buy template studio for custom template creation/management.
    Free (console version)
    Comes as templates so add/update or manage as you wish.
    On-fly code generation, you don’t get to see templates or whatsoever. Gives control over the whole process, top-bottom, as they are managed by individual templates
    Does not create DB schema/generation. Creates the whole DB structure ie. Storeprocs, triggers, tables, functions etc
    N-tier generated with one go ie. If you change something in DB, you just regenerate the llblgen project and all files get updated. Individual template/batch file generation ie. You need to run B&D batch, channel batch etc one by one to get update files across 3 layer solutions.
    No webservices, remoting or channel server. Just uses classes and collections – entities, typelist, typeviews etc Can add as much layer separation between DB end and UI end. Can manage as you wish just by working on templates
    Less code – 2 projects, 1 solution More code, some redundant – multiple projects, 3 solutions
    N-tier project structure
    - Database Generic
    - Database Specific
    - UI
    (2 types: Adapter based or SelfServicing)
    N-tier project structure
    - Business and Data
    - Public Channels
    - Presentations
    (Add more as you wish)
    Do sorting, filtering, grouping, paging, all DB queries by a few class calls. (Dynamic queries) Need individual storeproc for each function. Adding one function needs to do individual updates for all projects and across solutions as well. Extensive use of storeproc.
    It is n-tier but basic multi tier structure which separate Business data code from UI codes. Advance/better n-tier architecture. Greater security and more control over each layers.
    Easier code generation + usage + less error generation. Need proper setup or you’ll get tangle in between. Small error in your base template will affect the entire project code.
    You write very little code ie. Only need to write for UI code. You have to write all the codes for your based templates if you don’t already have templates in hand.
    Provide .net 1.1, and .net 2.0 classes, ready to use and choose whichever you need. No .net 2.0 codesmith templates for us yet. Can use third-party templates but it will cost us.
    It doesn’t require dotnet framework and work independently. Uses dotnet framework as main backbone.

    # References:

    # Debate: O/R Mapping or Code Generation : Lots of discussion going on there in the reply threads.
    # Your Favorite O/R Mapper? : A discussion on O/R Mappers
    # CodeSmith Rocks! | When code generation goes bad…
    # LLBLGenPro vs CodeSmith w/ .netTiers

    Flickr Photos

    Downloads

    Twitter Status


    Goodie Links


    Mayvelous Friends


    I'm an Author for Global Voices

    Archives