Version conflicts

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/17/2015 4:43:04 AM
Gravatar
Total Posts 5

Version conflicts

I ran into a strange issue today.

After hours of grappling with it, I finally resolved it so I thought I'd post about it here in case anybody else runs into the same issue.

I've been trying to create a new feature through creating a new user control in my own project which inherits from SiteModuleControl to get this to work one has to add a reference to mojoPortal.Web, but while I was about it, I decided to also add references to all the other mojoPortal projects including mojoPortal.Features.UI

The frustrating thing I ran into was that while my application worked perfectly and the control worked perfectly in the visual studio virtual host (http://localhost:54427/my-points), the moment I published it to my local IIS, the page that was supposed to be showing the control (http://localhost/CCRC/my-points) was empty.

After hours of trying different things, stumped as to why it was rendering my control in the virtual environment but not when published to my local IIS, I discovered the message log.

If you ever have a control that doesn't render, go and see the message log. (Administration menu -> System Log) Lesson learnt.

The message log had a strange error message for my local IIS version

2015-03-17 08:18:33,574 ERROR 10.2.1.42 - en-US - /CCRC/my-points - mojoPortal.Web.UI.CmsPage - failed to load control CRC/GameModule.ascx 
System.Web.HttpCompileException (0x80004005): C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\ccrc\b542d2c2\9cc6dcc1\App_Web_gamemodule.ascx.dd0192e0.vyzuu07z.0.vb(54): error BC32206: The project currently contains references to more than one version of mojoPortal.Web, a direct reference to version 1.0.5549.21374 and an indirect reference (through 'CRC.Web.GameModule') to version 1.0.5554.3470. Change the direct reference to use version 1.0.5554.3470 (or higher) of mojoPortal.Web.
   at System.Web.Compilation.AssemblyBuilder.Compile()
   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.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate)
   at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath)
   at mojoPortal.Web.UI.CmsPage.LoadPage()

Even though my own project containing the control was only referencing mojoPortal.Web once and even though I only had a single copy of mojoPortal.Web, somehow it thought it was referencing 2 different versions of this.

More hours were then wasted trying to figure out how multiple references to a single project could exist with different version numbers. After numerous attempts add adding and removing references and restarting visual studio, I realised that my own project was directly referencing 1.0.5549.21374 (as the error message indicated), but for some reason mojoPortal.Features.UI was referencing version 1.0.5554.3470. I still don't understand how this can happen when they are pointing to the same project.

I resolved this by removing all references to mojoPortal.Web from my project and mojoPortal.Features.UI and deleting all copies of mojoPortal.Web.dll that I could find within these projects bin folders. I then built mojoPortal.Web to regenerate the dll, I then added back the references that I had removed and built mojoPortal.Features.UI as well as my own project.

After deleting the old dlls from my webapplication within IIS and republishing them, it seems to have resolved the problem.

So watch out for spurious version mismatches!

3/17/2015 4:46:06 AM
Gravatar
Total Posts 5

Re: Version conflicts

The other thing I noticed was that this problem only existed if I inherited from SiteModuleControl. If I inherited from the standard UserControl, the problem disappeared.

This didn't help me much though because I needed to reference a number of user settings.

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