MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Creating a Custom Project  (Mono Support )

Viewed 35720 time(s), 5 post(s) 10/8/2013 6:00:28 PMby erin0201
erin0201

erin0201

10/8/2013 6:00:28 PM
I have installed and "customized" all of the default css, themes, etc in Monox a few times now.  However, I've never been able to get started on a custom project so that my MonoX could be updated when new versions come out.
I'm trying again to get that working and am still having trouble.

I'm following this article:
http://www.mono-software.com/blog/post/Mono/95/Building-a-custom-ASP-NET-project-based-on-MonoX/?blogcommentspageno=1

I have my folder structure like this:
RootFolder >
App_Browsers
App_CustomLocalization
App_Templates
App_Themes
Backup
bin
Code
Membership
MonoX
obj
Portal (my project name)
Properties
Upload

And then the files Blog.aspx, default.aspx, login.aspx. etc..

Inside of the Portal folder I basically copied everything from the MonoX folder to it.
I copied the sln and csproj files to the root folder as requested and renamed the solution to Portal.
I opened the solution up in Visual Studio Express 2012 for Web.
I clicked to have it show all files and added the Portal folder to the solution.
I changed the default.master page inside of the Portal > MasterPages folder to match the sample master page in the instructions.  I actually just changed the Inherits and then changed the source for the module gallery to look inside of the Portal folder.
IE:
<%@ Master
    Language="C#"
    AutoEventWireup="True"
    EnableTheming="true"
    Inherits="Portal.Web.MasterPages.Default"
    MasterPageFile="/MonoX/MasterPages/MonoX.master"
    Codebehind="Default.master.cs" %>
<%@ MasterType VirtualPath="/MonoX/MasterPages/MonoX.master" %>
<%@ Import Namespace="MonoSoftware.MonoX.Resources" %>
<%@ Register TagPrefix="MonoX" TagName="Menu" Src="/Portal/ModuleGallery/MonoXMenuHTML5.ascx" %>
<%@ Register TagPrefix="MonoX" TagName="Search" Src="/Portal/ModuleGallery/MonoXSearchBoxWithFilter.ascx" %>
<%@ Register TagPrefix="MonoX" TagName="PageFooter" Src="/Portal/MasterPages/PageFooter.ascx" %>
<%@ Register TagPrefix="MonoX" TagName="MembershipNavigation" Src="/Portal/MasterPages/MembershipNavigation.ascx" %>
<%@ Register Assembly="MonoX" Namespace="MonoSoftware.MonoX" TagPrefix="portal" %>
<%@ Register Assembly="MonoX" Namespace="MonoSoftware.MonoX.SearchEngine" TagPrefix="Search" %>
 
<asp:Content ContentPlaceHolderID="cp" runat="server">
    <asp:ScriptManagerProxy ID="scriptManagerProxy" runat="server"></asp:ScriptManagerProxy>
    <header>
        <div class="container top-section clearfix">
            <div class="row-fluid">
                <div class="span12">
                    <a href='<%= MonoSoftware.Web.UrlFormatter.ResolveServerUrl(MonoSoftware.MonoX.Utilities.LocalizationUtility.RewriteLink("/")) %>' class="logo">
                        <img id="Img1" runat="server" src="<%$ Code: MonoSoftware.MonoX.Paths.App_Themes.img.logo_png %>" alt="MonoX" />
                    </a>
                    <MonoX:Menu runat="server" ID="ctlMenu" UseSpanElementsInMenuItems="false" SelectedItemCssClass="selected" CacheDuration="600" ResponsiveDesignBrakeWidth="959" />
                </div>
            </div>
        </div>
        <div class="bottom-section">
            <div class="container">
                <div class="row-fluid">
                    <div class="span12">
                        <div class="membership-search">
                            <img runat="server" src="/App_Themes/Default/img/membership-search.jpg" alt="Memebership bg" class="membership-bg" />
                            <div class="membership-navigation-holder">
                                <MonoX:MembershipNavigation runat="server" ID="ctlMemership" LoginStatusLogoutText=" " />
                            </div>
                            <div class="search-holder">
                                <MonoX:Search runat="server" ID="ctlSearch" TextBoxCssClass="mainSearchBoxInputField" ButtonCssClass="searchImage" ButtonText="Go" DefaultSearchText="<%$ Code:DefaultResources.SiteSearch_DefaultText %>">
                                </MonoX:Search>
                            </div>
                        </div>
                        <img runat="server" src="/App_Themes/Default/img/banner.jpg" alt="Banner" class="banner-img scale-with-grid" />
                    </div>
                </div>
            </div>
        </div>
    </header>
     
    <asp:ContentPlaceHolder ID="cp" runat="server">
    </asp:ContentPlaceHolder>
 
    <MonoX:PageFooter runat="server" ID="ctlFooter"></MonoX:PageFooter>
</asp:Content>


I then went to the root folder and changed the default.aspx page so that it was looking into the Portal > MasterPages file for the default.master in there.  I also changed the Inherits to Portal.Web.Default like the sample default page showed in the instructions.
<%@ Page
    Language="C#"
    AutoEventWireup="true"
    MasterPageFile="/Portal/MasterPages/Default.master"
    Inherits="Portal.Web.Default"
    Title="MonoX - Portal Framework for ASP.NET"
    Codebehind="Default.aspx.cs" %>
     
<%@ MasterType TypeName="MonoSoftware.MonoX.BaseMasterPage" %>  
  
<%@ Register TagPrefix="MonoX" TagName="Editor" Src="/MonoX/ModuleGallery/MonoXHtmlEditor.ascx" %>
<%@ Register TagPrefix="MonoX" TagName="Rss" Src="/MonoX/ModuleGallery/RssReader.ascx" %>
<%@ Register Assembly="MonoX" Namespace="MonoSoftware.MonoX" TagPrefix="portal" %>
<%@ Register Assembly="MonoX" Namespace="MonoSoftware.MonoX.ModuleGallery" TagPrefix="ModuleGallery" %>
<%@ Register TagPrefix="MonoX" TagName="AdModule" Src="/MonoX/ModuleGallery/AdModule.ascx"  %>
<%@ Register TagPrefix="MonoX" TagName="SlideShow" Src="/MonoX/ModuleGallery/SlideShow.ascx"  %>
 
 
<%@ Import Namespace="MonoSoftware.MonoX.Resources" %>


When I try to load the default.aspx page now I get an error:
his event has been logged and will be addressed by the maintenance department. We appreciate your patience.
 
c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\51545029\bb8ce8ba\App_Web_updatepanel.master.f3b849cc.rdvuldk-.0.cs(330): error CS0433: The type 'MonoSoftware.MonoX.Paths' exists in both 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\51545029\bb8ce8ba\assembly\dl3\1c290a24\002f003e_2c69ce01\MonoX.DLL' and 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\51545029\bb8ce8ba\assembly\dl3\0dc83a87\7540e0ba_4cc4ce01\ProjectName.Web.DLL'
at System.Web.UI.TemplateParser.ProcessException(Exception ex) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath) at System.Web.UI.TemplateParser.Parse() at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType() at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
I'm not trying to do anything fancy with this.  I just want to be able to apply updates to the MonoX folder whenever they come out going forward on this new website.

I opened the solution from my laptop, Windows 7 64bit, but the website is located on IIS 7.5 on Server 2008 Enterprise.

Any suggestions?

Thanks!
Erin0201

This content has not been rated yet. 
453 Reputation 61 Total posts
khorvat

khorvat

10/9/2013 7:46:22 AM
Hi,

you can go with this approach, but it seems to me that you will have much more changes this way and you will also have much more work while synchronizing changes from new MonoX versions. My other suggestion would be to use VCS (Git, SVN, etc.) and commit the original code, then make your changes directly inside the MonoX code (MonoX folders) and commit them to VCS. When new MonoX version comes you will have everything in the VCS so you can overwrite everything with new MonoX code then before you commit take a look at the changes via Diff tools and pull in your custom code to new MonoX code.

c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\51545029\bb8ce8ba\App_Web_updatepanel.master.f3b849cc.rdvuldk-.0.cs(330): error CS0433: The type 'MonoSoftware.MonoX.Paths' exists in both 'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET
Regarding the error above you will have to change the Paths.tt and RewrittenPaths.tt in your solution to point to your namespace and your class, or remove it completely from the solution if you don't intend to use it.

Let us know if you need more information.

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
erin0201

erin0201

10/10/2013 11:36:22 AM
Thanks for your reply!

I am going through the Git tutorial now.  I've never used it before.
That definitely sounds like a better approach.  Do you have any blogs or articles or step-by-steps on using Git and Diff tools to pull in new MonoX code, compare with Diff tools, and pulling the old code into the new code?

This content has not been rated yet. 
453 Reputation 61 Total posts
khorvat

khorvat

10/10/2013 11:46:00 AM
The best place to start is the Git home page, there is a documentation, wiki and try it in your browser pages. Also I'd recommend the SourceTree or TortoiseGit tools as one of the easiest ones.

I hope this helps a bit.

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
erin0201

erin0201

10/10/2013 8:16:37 PM
Thanks Khorvat!

I downloaded Sourcetree and followed the tutorial on what Git is and does.  I think I finally understand how to use it so that I can use it to update just the monox files that change and make sure any of my changes are copied down first.

Thanks again!
This content has not been rated yet. 
453 Reputation 61 Total posts