Post Build Events

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
3/30/2012 9:30:39 AM
Gravatar
Total Posts 148

Post Build Events

 

I added a User Control to the layout.Master in my skin folder.  When I edit the control the layout.Master is not aware of it so the compiler continues to use the previous builds version.  Is there a way around this?

3/31/2012 12:28:01 PM
Gravatar
Total Posts 148

Re: Post Build Events

I think I know what I was doing wrong...this is to help anyone who MAY make the same mistake (if it is a mistake). I placed a copy of the layout.Master from my skin folder in the App_Themes folder of my project.  I did this for two reasons.

1) To easily edit and change it.

2) To back it up when I back up my project.

My post build events simply copied the layout.Master to my skin folder after a successful build. This is where I THINK the problem was occurring.  When I changed one of the controls that exist in my layout.Master file the compiler was not aware of it because the App_Themes folder is not compiled during a build.  When the layout.Master file was copied to my skins folder, mojoPortal was using the most current compiled version. 

Does this explanation make sense? 

4/2/2012 8:58:04 AM
Gravatar
Total Posts 18439

Re: Post Build Events

compilation of the layout.master is not a factor and recompilation of layout.master is not required when you make changes in your UserControl, but you must rebuild your custom project after every change so that it copies the latest version of your .ascx file and your dll up to the web. Even small changes in the .ascx require you to build it again so it gets copied by the post build event.

editing the layout.master in the skin folder of your skin is the only place you need to edit layout.master. Unlike the custom user control custom layout.master does not go in your custom project and is not copied by post build, it only needs to exist in the skin folder under /Data/Sites/[SiteID]/skins/[yourskinname]

However if you make any mistake in editing layout.master it will fail to load and will fallback to loading it from /App_MasterPages to prevent from crashing the site but it will log an error. You should never edit the file /App_MasterPages/layout.master, only edit your own copy in your skin folder and if something goes wrong check the log for an error about it.

Hope that helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.