Can't run user controls written in VB

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
10/6/2012 10:43:23 AM
Gravatar
Total Posts 7

Can't run user controls written in VB

SYSTEM INFORMATION
mojoPortal Version 2.3.9.0 MSSQL
Operating System Microsoft Windows NT 6.0.6002 Service Pack 2
ASP.NET Info v4.0.30319 Running in Full Trust

I've been trying to run the VB.net example from http://www.mojoportal.com/usinginlinecode.aspx

When I try to use the module on a page I get the following in the system event log:

System.Web.HttpCompileException (0x80004005): D:\hosting\9222742\html\vivaolvera\User_Controls\PNUserControl.ascx(28): error BC32206: The project currently contains references to more than one version of mojoPortal.Business, a direct reference to version 1.0.4580.26344 and an indirect reference (through 'mojoPortal.Web.SiteModuleControl.ModuleConfiguration') to version 1.0.4597.22201.
Change the direct reference to use version 1.0.4597.22201 (or higher) of mojoPortal.Business.
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()

I've tried a rewrite of the same module in C# and it works fine. I saw this mentioned in an earlier post but there was no solution given.

Reason I'm looking at this is I have a big VB.Net web site that I need to move to Mojoportal and dropping the source to VB user controls will be less work than porting the code C#. A work-around would be most appreciated.

10/6/2012 11:15:04 AM
Gravatar
Total Posts 18439

Re: Can't run user controls written in VB

Only workaround I can think of that should work is:

1. Work with the mojoPortal source code not the pre-compiled deployment packages

2. Don't use inline code, put your controls into your own VB.NET project and use code behind so that the VB code is compiled into a dll and use a post build event to copy the dll to the Web/bin and copy your .ascx into your own folder. See the post build events in the mojoPortal.Features.UI project or WebStore.UI project for examples

3. Use project references to mojoPortal rather than  dll references and in those cases if you do reference a dll, in the reference properties set Specific Version to false.

Hope that helps,

Joe

10/6/2012 11:47:58 AM
Gravatar
Total Posts 7

Re: Can't run user controls written in VB

Thanks Joe, I'll give that a go. 

10/10/2012 3:12:34 PM
Gravatar
Total Posts 7

Re: Can't run user controls written in VB

You were right and I'm now running user controls authored in VB - that will save me a bunch of time, so a very big thank you!

For any other people going down this path, the only snag I met was that the express version of visual studio 2010 doesn't support post build events for visual basic but it's a trivial matter to rig up a batch file to copy the dll and ascx files - just copy the post build events from a C# project and change the paths.

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