Problem to load mojoportal.net40.sln solution in recent VS 2013

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/2/2015 7:08:51 AM
Gravatar
Total Posts 18

Problem to load mojoportal.net40.sln solution in recent VS 2013

This originally started as an web installation/setup issue trying to make mojoPortal run on mod_mono and Apache

https://www.mojoportal.com/Forums/Thread.aspx?pageid=5&t=13033~1#post53776

but I then decided to go source code instead and load it in VS 2013, which appears to be problematic. The reason for this was that I suspected it may had something to do with a Framework 4.0 vs 4.5 class, to which Joe Audette replied

no, nothing specific to mojoportal, its just confusing semantics for .net versions, 4.5 is an in place upgrade for 4.0 and is still considered 4.0 clr/runtime similarly 3.5 .net was really 2.0 clr/runtime

so 4.5 is an upgraded version of 4.0, if 4.5 .net is installed it actually replaces any previous 4.0 version and the framework still reports itself as 4.0.....

only that last segment of the version would change for 4.5 vs 4.0

However, it doesn't seem to be that simple, as when I try to load the solution file meant for VS 2013 it pops an option dialog during preparation of the solution

Project Target Framework Not Installed

The C# project "mojoPortal.WEb.Controls" is targeting ".NETFramework,Version=v4.0, which is not installed on this machine. To proceed, select an option below.

0 Change the target to .NET Framework 4.5. You can change back to ".NETFramework, Version=v4.0" at a later time.

0 Download the targeting pack for ".NETFramework,Version=v4.0". The project will not change.

0 Do not load the project.

[OK]

Due to we are on different time zones I got a bit impatient  waiting in the other tread, and as Joe implied it was merely "semantic confusion" I tried to load the first and default selected option to "Change the target to .NET Framework 4.5" but that resulted in 1000+ errors all over the place, which didn't surprise me - I just wanted to see what happened as the release setup package indeed imply it IS 4.5 which doesn't seem to be the case, at least not with the default branch downloaded with Mercurial.

So I reverted all changes VS did to the files and tried again, this time selecting option "Download the targeting pack for ".NETFramework,Version=v4.0"" which causes an instance of a .NET page to be loaded for each project the solution loads, as it pops a new instance of the option dialog - apparently until the needed files have been installed, which most likely can't be done while VS is running - but I haven't got there yet, because...

The .NET web page suggest that Target platform .NET Framework 4 is Included in Visual Studio 2013, just as 4.5 and 4.5.1 are, but there is also another one .NET Framework 4.0.3 and on opening the Control Panel looking at installed programs I can see 4.0.3 is installed but not the plain 4.0 that mojoPortal seems to want/need. I can only understand this as 4.0 has been replaced by 4.0.3 in current release of VS 2013 and I fear that installing 4.0 would be a step backwards and may even make havoc to the installation, so where to go from here? Are you guys lagging behind with the version of VS you use or?

I really would like to get this to work as MP seems very promising for my needs and a planned bigger project, and will no doubt buy you a beer if I get it working and later most likely at least one of your add-ons if it lives up to my expectations. My preference is of course to target 4.5 to harmonize with the other part of my project but that's not needed initially.

3/2/2015 8:34:57 AM
Gravatar
Total Posts 18439

Re: Problem to load mojoportal.net40.sln solution in recent VS 2013

those .net35 and .net40 .sln and csproj files no longer work, they are left over relics from when we did support .net 3.5 and .net 4.0. Currently we only support .net 4.5 and you should use the mojoportal.sln.

I guess I should remove those legacy files since they are causing people confusion, I kept them because if someone who is an expert in .net really needed to produce a build for an older framework those would be a start in the right direction but they are broken and would require much intervention to resurrect them to working order, and web.config files would also have to be downgraded to be compatible and target frameworks would need to be changed and some code would need to be changed or left out to make a build possible.

I will remove those legacy files later today since this is the second time recently when they have caused confusion.

3/2/2015 8:51:12 AM
Gravatar
Total Posts 18

Re: Problem to load mojoportal.net40.sln solution in recent VS 2013

Hi Joe,

I am sorry to say but mojoportal.sln indeed gives the same result. Have you possibly missed to merge the correct one to default? When you open the files in a text editor mojoportal.sln says it's for VS2012 while mojoportal.net40.sln say its for VS 2013, and the readme seem to be rather outdated as well... Something seems to have got wrong somewhere...

3/2/2015 9:54:43 AM
Gravatar
Total Posts 18439

Re: Problem to load mojoportal.net40.sln solution in recent VS 2013

make sure you have VS 2013 update 4, look under Help > About in VS to see the version

open the mojoportal.sln, and choose Rebuild Solution from the Build menu, it should pull down a bunch of things from NuGet and build with no errors

It works for me

if you previously made changes about build targets and such you  need to revert that.

3/2/2015 10:51:02 AM
Gravatar
Total Posts 18

Re: Problem to load mojoportal.net40.sln solution in recent VS 2013

Microsoft Visual Studio Ultimate 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.51209

I haven't done any changes afai know.

It works for me

Well obviously you don't use the same solution file as me :-( 

Mine clearly insist on projects included in solution being of .NET 4.0 and not .NET 4.5 Framework.

I used TortoiseHG 3.3 to clone the Default branch (Rev 5837) according to your instructions or that's what I got at least. Have you really tried to get the default branch to test, I bet you are running from your private development branch and must have a different solution file than what Default serves?

 

 

3/2/2015 11:04:05 AM
Gravatar
Total Posts 18439

Re: Problem to load mojoportal.net40.sln solution in recent VS 2013

I suspect you have pulled the latest changes from tortoisehg but have not updated your working copy so you have an older version of files without changes applied. right click the top level folder in windows explorer and choose TortoiseHG > Update , set the branch Update To as default and check the box to discard local changes.

3/2/2015 1:45:31 PM
Gravatar
Total Posts 18

Re: Problem to load mojoportal.net40.sln solution in recent VS 2013

Unfortunately, no difference. No easy way to attach a screen shot here so will describe the dialog.

Title Caption: Update - mojoportal

Update to: default

Target: (same as parent)

Parent: 5837 (d880ccb8be98) default tip

below it: merge stable changes from joedev branch to default branch

Options:

List updated files (--verbose) - Unticked

Discard local changes, no backup (-C/--clean) - Ticked

Always merge (when possible) - Unticked

Automatically resolve merge conflicts where possible - Ticked

I click "Show details" button and then "Update" and I get this in the window:

% hg update --config ui.merge=internal:merge --rev default --clean
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
[command completed successfully Mon Mar 02 20:35:50 2015]

I don't know what's up, this is first time ever I use Mercurial and ToroiseHg as for my own stuff I use Subversion and TortoiseSVN, but I cannot see anything being wrong with my wc here, it should be up-to-date. All just plain strange...

3/2/2015 1:58:21 PM
Gravatar
Total Posts 18

Re: Problem to load mojoportal.net40.sln solution in recent VS 2013

I did a "Revision History" check on mojoportal.sln and it was last changed in rev 5214 (joedev) : "make email template editor also edit the plain text version of the template ..." 21 months ago...

while for mojoportal.net40.sln it was rev 5634 (joedev): "create new solution and new ui projects targeting .net4, changed main projects and solution to net 4.5 ... 9 moths ago

and that doesn't really seem to add up to me, if it can be of any help, looks like any change to mojoportal.sln must have got lost somewhe, somehow and never made it to default. That's how I read it anyhow.

3/2/2015 2:10:02 PM
Gravatar
Total Posts 18439

Re: Problem to load mojoportal.net40.sln solution in recent VS 2013

no, the net40.sln file was created at the time when we copied the csproj files as net40.csproj to keep the net 4.0 build target for legacy purposes, then we changed the build targets in the main .csproj files to use net 4.5. therefore no change was needed in the mojoportal.sln at that time, but the new (at that time) net40.sln had to be changed to point to new (at the time) net40.csproj file names 

so we had multiple sets of projects and .sln that referenced the same mostly .cs files but the build targets were different and some conditional compilation was used to account for unsupported things in older framework

the main up to date files have no reference to any framework version in their file names, ones with a name like that were created to support legacy framework versions but are no longer supported, and as of today the legacy .sln files have been removed from the repository

3/2/2015 2:24:53 PM
Gravatar
Total Posts 18439

Re: Problem to load mojoportal.net40.sln solution in recent VS 2013

I just did another clean clone of the default branch and rebuild solution works as expected for me

3/2/2015 2:48:11 PM
Gravatar
Total Posts 18

Re: Problem to load mojoportal.net40.sln solution in recent VS 2013

So THg has it wrong then when it says mojoportal.net40.sln (was added) in rev/changeset 5634, with age 9 months? It's hard for me to believe, sorry. And mojoportal.sln was last changed 12 months before that, it's all in the repo's history.

But more important, which file am I then supposed to use to load mojoportal code in VS2013? mojoportal.sln obviously doesn't work as it's outdated and complains about missing 4.0 target files, offering to either download them - which obviously is the wrong move - or convert to 4.5 which results in an ridiculously amount of errors (killed it half ways at 16104 errors in 860199 files), while mojoportal.net40.sln has somewhat better with only 1020 errors in 288 files.

I mean clearly something is wrong with the set of files your repo offers, or offered, from the default branch current rev. Maybe it will be different with the changes you say you have done now but so far there is nothing new coming down when updating default. I guess I have to wait until the merge to default is done.

3/2/2015 2:58:40 PM
Gravatar
Total Posts 18439

Re: Problem to load mojoportal.net40.sln solution in recent VS 2013

"So THg has it wrong then when it says mojoportal.net40.sln (was added) in rev/changeset 5634, with age 9 months? It's hard for me to believe, sorry. And mojoportal.sln was last changed 12 months before that, it's all in the repo's history."

that is all true, as I told you changing our target to 4.5  did not require changes to mojoportal.sln, the mojoportal.net40.sln was a newer file, it required changes, revision history is correct

target framework is not set by the solution, if you right click a project node (mojoPortal.Web project for example) and choose properties you should see the projects target .net 4.5 framework.

mojoportal.sln is the correct file, it is not out of date for me nor out of date in the repository and I know there are many others using our source code not having any problem

why it is not working for you is a mystery to me

 

3/2/2015 3:05:40 PM
Gravatar
Total Posts 18439

Re: Problem to load mojoportal.net40.sln solution in recent VS 2013

some of the business layer projects do target 4.0 and data layer projects still target 3.5

maybe your machine is complaining about the business layer projects and wants to install  a reference copy of 4.0 for compilation purposes, just let it do that. these class libraries work just fine in 4.5 hosting (because 4.5 is 4.0 runtime as mentioned before), even though they are compiled for 3.5 or 4.0, we could change them to target 4.5 but have not needed to, the web layer is where we got some new things we needed in 4.5

3/2/2015 3:16:17 PM
Gravatar
Total Posts 18

Re: Problem to load mojoportal.net40.sln solution in recent VS 2013

I just did another clean clone of the default branch and rebuild solution works as expected for me

It's really really strange, can I be doing something wrong when I do the clone. As I said, I have never used Mercurial or THg before, using TSVN on a daily basis. I use THg 3.3 and as Source I had:

https://hg.codeplex.com/mojoportal

Destination:

C:\Astrocalc Projects\wchg

All options unticked, as they come by default

Hg command: hg clone --verbose https://hg.codeplex.com/mojoportal C:\Astrocalc Projects\wchg

I did it all again, now getting your updated revision, but still same result as mojoportal.sln hasn't changed.  I simply don't f@1$n get it!

3/2/2015 3:20:06 PM
Gravatar
Total Posts 18439

Re: Problem to load mojoportal.net40.sln solution in recent VS 2013

I think I understand the problem now, as stated in my last post

only the web ui projects actually target 4.5, some projects in the solution still target older frameworks 4.0 and 3.5, VS needs a reference copy of those frameworks to compile those projects. My machine and most others using our code already have these reference frameworks but your machine does not, so it prompts you to install it, you should just go ahead and let it install 4.0 or whatever it wants to install

3/2/2015 4:27:18 PM
Gravatar
Total Posts 18

Re: Problem to load mojoportal.net40.sln solution in recent VS 2013

Well that makes sense, however, I have a problem to conclude exactly which files to download as the VS 2013 page offers 2 options for NET 4.0, original 4.0 which is says is included in VS2013 and 4.0.3 which appears to be on my machine (when looking at installed programs in the CP). Problem is also that when I choose to download the 4.0 files as VS suggest, it doesn't goes ahead and do it but send me to some Czech MS pages that has nothing to with it. I'm not Czech, but lives here because my wife is Czech, so may way to the English download pages are manual so to speak.

Also, after opening another project and looking at available targets to set on the project page 4.0 surely is missing, but do I install 4.0 or 4.0.3 - that's the question - and how can I be sure it wont f*ck up my VS2013 installation? It sure sounds as it would make sense to me to have the full project set to 1 target (i.e 4.5) instead of 3 as now, which sounds like a receipt for trouble somewhere down the road.

At least we seam to have come to an understanding of what the problem is, so some progress at last ;-)

3/3/2015 8:14:20 AM
Gravatar
Total Posts 18439

Re: Problem to load mojoportal.net40.sln solution in recent VS 2013

I think I would go with 4.0

I do not think it will mess up your vs installation

I think when VS 2013 originally shipped it did ship with .NET 4, but apparently now in later versions (update 4) it ships with 4.5 instead

There are very good reasons why some projects in our solution target older frameworks. Until recently we supported 3.5, 4.0, and 4.5 .net and keeping the business and data layers using lower frameworks meant we did not need different versions of those layers, the same version worked with any of the web ui projects, only the web ui projects targeted higher frameworks 4 and 4.5

.NET is largely backward compatible so assemblies compiled against older frameworks can easily be deployed in newer hosting/runtime environments. When we say mojoPortal requires .NET 4.5, we mean it requires .NET 4.5 hosting, it doe snot mean every included assembly is compiled for 4.5. Whether all assemblies target 4.5 for compilation is a separate issue. Since we no longer support 3.5 or 4.0 we could change all our projects to target 4.5 but I have been reluctant to do that because I've wanted to keep it not too difficult for an expert to make their own build for older frameworks and there was no real need to change the target for the business and data layers. If I decide to do that for the next release of mojoPortal it will mean I also have to make corresponding compatibility releases for all of our add on products even though they have no new features, and anyone upgrading mojoPortal will have to upgrade those features at the same time, and the new version of those features won't be compatible with any previous version of mojoPortal, so that will be kind of a hassle and I'm not in a hurry to do it.

I recommend install the needed reference framework for VS.

You could conceivably change the build targets on all the projects in your local copy, but it has to be done in a correct sequence or you will lose project references in the process. Unless you are a super expert I don't recommend that.

3/3/2015 9:25:10 AM
Gravatar
Total Posts 18

Re: Problem to load mojoportal.net40.sln solution in recent VS 2013

Hi Joe and thanks for staying with me... I did indeed now install everything .NET4 MS has on offer, but to no avail, VS2013 still refuses to have any knowledge of .NET4 targeting - except pointing out that some of the included projects need it. Got a bit frustrated there for a moment and left the computer... instead of smashing it ... and then get the idea of not reinstall but run a repair from CP, which is still running and seem to take an eon but I have already seen it pulling down .NET4 Multi-targeting something, so maybe when it's done with its thing I finally can load the project. At least I still have hope!

I can understand your rationale for keeping parts in 3.5 and 4.0, but one thing hot me - can it be the reason why it fails so miserably on Mono already when running Setup? I am pretty sure that the mod-mono-server4 doesn't support 3.5, although as I understand it from what you say are everything running on the web server 4.5?

No, I'm not an expert, at least not on .NET and ASP.NET, maybe on VB6 ;-) which I eventually decided to give up to focus 100% on .NET, I have had VS.NET since version 2005 but due to heavy code investment in VB6 I have never really come to take the step for real, but then one day last year I decided I cannot postpone it any longer and started to convert my more important projects which I plan to expand on.

So while I have been reading books and studied .NET (mostly VB) for several years, I have never come to use it until now, and ASP.NET I just started to look at a few weeks ago and now I probably have to learn C# as well.  Anyway, I will let you know how it goes once the repair is done, it's just about half way so far so maybe another hour...

 

3/3/2015 12:33:18 PM
Gravatar
Total Posts 18

Re: Problem to load mojoportal.net40.sln solution in recent VS 2013

Ok finally success! It loads w/o any complaint about .NET4.0, BUT, in the status bar right corner it says "3041 errors in 580 files" so I then choose to rebuild the solution as per your instructions and it pull down a few things from Nuget, and the errors ticks down to "592 errors in 220 files" and status bar left says "Rebuild All failed"  - what am I missing?

3/3/2015 12:47:26 PM
Gravatar
Total Posts 18439

Re: Problem to load mojoportal.net40.sln solution in recent VS 2013

I suggest try rebuild solution again, does it do the same thing each time?

make sure in the build profile dropdown you have Debug selected, though any of the options shown in the image in this article should work

Maybe try again after a reboot since you just installed a bunch of stuff.

Ignore the warnings in yellow, if after reboot and retry then give an example of the kind of errors

3/3/2015 2:19:01 PM
Gravatar
Total Posts 18

Re: Problem to load mojoportal.net40.sln solution in recent VS 2013

Yes I have Debug selected, and the other DropDown has "Mixed Platforms". After reboot I now have "549 errors in 211 files" instead, in the statusbar. To the left it now says "Ready" but how can I check it was rebuilt?

There is also an "Error List" pane in lower part of window, which seem to be different to the 549 errors. There is just 1 error and 26 warnings. The error there is:

Error    1    The command "C:\Projects\wc\mojoportal\LanguageRemover\bin\Debug\LanguageRemover.exe C:\Projects\wc\mojoportal\Web\App_GlobalResources" exited with code 9009.    LanguageRemover

Among the 549 errors there are things like:

"Cannot find usage of Class 'cleared'" and Cannot find Skin 'cleared'" in this line from BingMapModule.ascx

<portal:EmptyPanel id="divCleared" runat="server" CssClass="cleared" SkinID="cleared"></portal:EmptyPanel>

and in BlogCompare.aspx "Cannot find ContentPlaceHOlder 'phHead' in in the Master page '~/App_MasterPages/DialogMaster.Master'

and an ASP.NET runtime error for that page 'Could not load file or assembly 'AjaxControlToolkit, version 4.5.7.1213, ... or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

Just as some samples as it's a lot to type... but maybe it gives you an idea?

 

 

3/4/2015 8:21:56 AM
Gravatar
Total Posts 18

Re: Problem to load mojoportal.net40.sln solution in recent VS 2013

Wait a minute, I wonder if the small widget at far right of the statusbar, reporting "549 error in 211 files", isn't provided by one of the Add-ons I have installed, Resharper and CodeSmart, and that it reports this simply because it doesn't understand what we are doing here. It appears as if those errors all have their origin from direct or derived references done in the <% Page Directive %> which aren't available until the solution have been built and these pages exists at their proper place - or something like that as I haven't wrapped my head around everything yet. But is that a reasonable observation?

I guess I will just have to run the web site and see what happens, but I seem to have stuck my nose into a flu here and simply have to put it aside for a few days while riding out a fever taking hold...

3/4/2015 8:53:54 AM
Gravatar
Total Posts 18439

Re: Problem to load mojoportal.net40.sln solution in recent VS 2013

that sounds like a reasonable theory, only the one single error sounds expected and it is irrelevant.

I suggest copy the mojoportal.sln file to a new location and rename it like mojoportal.custom.sln or whatever, then copy it back to the original folder.

open the new custom solution, right click the LanguageRemover project and choose remove to remove it from the solution, it is not needed and was resulting in one build error which was just a distraction.

rebuild the solution

copy the user.config.sample file as user.config and set a connection string there for a new empty mssql db

launch the mojoportal.Web project

errors are expected at this point since the db is empty, just click continue on any error in the debugger, it should eventually redirect to /Setup which will run the sql scripts to solve the errors

if you decide to develop custom features that plugin to mojoportal, you can now add your own projects to the custom solution. any custom code should be in your own projects so this is the standard way to get started.

by coincidence I'm also coming down with scratchy throat and low grade fever, spent yesterday afternoon in bed and plan to stay there all day today as well

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