Latest from the umbraco blog

We're more transparent than glass. Follow us on twitter and our blog.

 

Friday, July 31, 2015 by Sebastiaan Janssen

Surprise! We weren't planning on doing another beta but we found a good reason to do so after all.

The main reason we have one more beta of 7.3.0 (last one, we promise!) is that we're also upgrading 7.3 to use MVC5. We previously thought this would be a pretty dramatic change and a lot of work for upgrades. Turns out: we're already doing the WebApi2 upgrade and that's actually more work than the MVC upgrade. 

The upgrade to MVC5 promises some new features and performance updates but most of all, it will allow us to follow along with the regular bug fixes that the ASP.NET team is doing on them. The other thing that people care about is ease of development and unfortunately you have a lousy experience with MVC4 in Visual Studio 2015

There's a few other small updates between beta 2 and beta 3 most notibly the ability to actually remove the "Publishing was cancelled by a 3rd party add-in" message as promised in the previous post.

Note: Make sure to delete Microsoft.Web.Mvc.FixedDisplayModes.dll when you upgrade from 7.2, this dll is no longer necessary.

We need you!

Lastly, this is a shout out to all of you people working on recent 7.2.x websites. Please help us out: make a backup of your database and site, attempt and upgrade and see what happens. If all is well, great (we'd love to hear that too). If something doesn't work, let us know. We do our own tests on several configurations but we can't cover everything.

Package developers: please test your packages on a 7.3.0-beta3 install and report back (good or bad) so we know what to expect.

Thanks and enjoy!  

Go get the beta 3 release now.

Wednesday, July 29, 2015 by Sebastiaan Janssen

So you've just installed the shiny new Visual Studio 2015 and all of your MVC views have squiggles all over the place.. Not exactly what you were expecting. This is because VS15 does not support MVC4 - time for an upgrade!

It took me a while to realize and, to be honest, I ignored the upgrade report when opening Umbraco projects in VS15. They clearly state: 

ASP.NET MVC 4 projects have limited functionality in Visual Studio Next. Commands such as Add Controller, Add View, Add Area, and Go to View/Controller are not available. Intellisense for Razor (CSHTML and VBHTML) files is limited to HTML markup. Please see http://go.microsoft.com/fwlink/?LinkID=320968 for additional information on how to upgrade an MVC 4 project.

And they aren't kidding around about that..

2015-07-29_110402

Background info: Umbraco 7 still ships with MVC4 but that's about to change for Umbraco 7.3.0.

Caveat: there is a bug in Umbraco that will affect you if you use MVC5 and a macro that tries to add things to the ModelState (example: `ModelState.AddModelError("MyField", "You made an error here");`. Fixes for that are mentioned later in this post.

NuGet

Over half of Umbraco installs are now being done using NuGet, this is great as we can help you much better during upgrades getting all of your config files in a consistent state so that upgrades are smooth as can be.

To get started, jump into your Package Manager console and execute these uninstalls:

Uninstall-Package Microsoft.AspNet.WebPages.Administration
Uninstall-Package Microsoft-Web-Helpers
Uninstall-Package Microsoft.AspNet.Mvc.FixedDisplayModes -Force

The first two packages will likely not exist in your install so they just give an error which you can ignore. FixedDisplayModes is an addition to MVC4 to fix a bug and is now obsolete. You have to `-Force` the unistall because Umbraco relies on it (but no longer when you upgrade to MVC5).

Then you can do the actual updates of MVC and WebApi. You also need to update ClientDependency to be compatible with MVC5:

Update-Package Microsoft.AspNet.Mvc
Install-Package ClientDependency-Mvc5
Update-Package Microsoft.AspNet.WebApi

At the time of writing you will receive MVC and WebApi versions 5.2.3. The NuGet packages are have built-in config transforms so your web.config and views\web.config should point to the newer versions for all of the dependencies (in the details for the manual install later in this article we'll point out the edits you should make if that didn't work).

That should do the trick! Try a build, run your site and it should all still look exactly the same as before.

Common problems
If you had `Microsoft-Web-Helpers` installed before and see errors relating to that when you run your site now, you'll probably need to install the following two packages to fix that: 

Install-Package Microsoft.AspNet.WebHelpers
Install-Package Microsoft.AspNet.WebPages.Data

If you're affected by the ModelState problem mentioned earlier you could either consider moving that logic out of your macros or install a fixed version of Umbraco 7.2.8:

Update-Package UmbracoCms -Version 7.2.8-fixedmodelstate -Source https://www.myget.org/F/umbraconightly/api/v2

This fixed version is exactly the same as the regular 7.2.8 release but there's been one change to fix the ModelState bug.

Manual installs

If you are not yet using NuGet you can also do your upgrade manually as well. The updated libraries for MVC, WebApi and ClientDependency can be downloaded and you can drop those dlls into your bin folder.

Then you will need to update your web.config's `runtime\assemblybinding` sections. There's a few bindingRedirects that need to be updated from v2 to v3 and from v4 to v5.2.3:

      <dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>

And then there's a few new ones you need to add in: 

      <dependentAssembly>
<assemblyIdentity name="System.Web.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Http.WebHost" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
<dependentAssembly>

There's also web.config files in your Views folder and sometimes also in App_Plugins folders, basically all they need is a search and replace using a text editor. Replace 2.0.0.0 with 3.0.0.0 and replace 4.0.0.0 (or 4.0.0.1) with 5.2.3.0 to make all the references correct.

If you're affected by the ModelState problem mentioned earlier you could either consider moving that logic out of your macros or install a fixed version of Umbraco 7.2.8. Copying the files in the bin folder to your own bin folder should do the trick. This fixed version is exactly the same as the regular 7.2.8 release but there's been one change to fix the ModelState bug and does not included the updated libraries or config changes above.

In closing

With this upgrade you should see no more squiggles. Close and re-open your cshtml files and bask in the beautiful code highlighting!

There will be edge cases that I haven't covered here. Most of the times there will be a bindingRedirect missing and if you google the error you're getting you should find the solution soon enough.

If you keep having problems then please post them in the following topic: https://our.umbraco.org/forum/getting-started/installing-umbraco/69478-intellisense-in-vs-2015.
This blog has no comment notifications and the forum does so if you want an answer and be notified about it then it's best not to use the comments her.

Monday, July 27, 2015 by Sebastiaan Janssen

We're thrilled to anounce the release of Umbraco 7.3.0 beta2 full of goodies and bugfixes!

Beta2 is now ready for download from our release page and through NuGet for your testing pleasure. This version is very close to what we want to deliver for the final release of 7.3.0. The final version will land in a few weeks, before the end of August.

So.. what's new?

Upgrading just got easier!

Migrations

You know that when you upgrade Umbraco to a new minor version (x.y.z == major.minor.patch) that there may be database upgrades, right? Well there may be! We don't do them for patch releases but 7.3.0 will upgrade your database. Not only that, you need to do that in all of the environments you have Umbraco installed in. Whether it's 2 databases that developers are using or it's your staging and live environment, you'd need to run the upgrade installer for each environment. This is easy to forget can lead to some unfortunate results.

Enter migrations: we now have a new table in the database (umbracoMigration) that stores that last migration that ran. Whenever we see that the current version of Umbraco doesn't match with the latest migration in that table, we automatically run the migration so you can deploy and don't have to worry about the database upgrade.

Localize anything outside of the /Umbraco folder

Previously if you've changed the translation files in ~/Umbraco/Config/Lang you'd have to be careful not to overwrite those files and merge them with the files in the version you're upgrading to. No more! Any key you add to ~/Config/Lang/*.xml will now overrule whatever is set in ~/Umbraco/Config/Lang and we don't touch the ~/Config/Lang folders during and upgrade. Happy translating!

Custom notifications

It's finally here: customizable notifications. When you hook into the publishing event and cancel it, you can now send ANY message back to the browser that you want. Add some useful information to that dreaded "Publishing was cancelled by a 3rd party add-in" (and yes, you can change the content of that message in ~/Config/Lang/*.xml)! You can add custom notifications through any eventhandler.
You're welcome.

3rdpartyaddin

Update: a little birdie just told me we can help you get rid of that orange bar as well, that's coming in the final release. 

Tree panel not wide enough?

Your editors are super enthusiastic and have added loads of content, many levels deep.. There comes a point where it gets hard to see what content they're going to edit. No longer a problem! Just drag the tree panel a bit to the right to see nodes very deep in the tree.

Dragpanel 

Other than that

You'll notice improvements to the icons in the tree, an updated layout for the image cropper, and of course many bug fixes since the first beta.

We think you'll really enjoy this update.