0
1

When trying to 'Perform' an upgrade, DataObjects.NET fails with:

Upgrade of assembly 'ProjectName' from version '1.0.0.0' to '1.0.4189.27538' is not supported.

Take note that only the version of the assembly has changed - none of the source files were relocated / modified.

If I manually change the 'Version' of the entry in Metadata.Assembly, everything works again as expected, but this isn't really a good way to upgrade in the future...

Any idea what is going on? The exception thrown didn't tell me why it is not supported, so I'm clueless.

asked Jun 21 '11 at 10:36

TimM's gravatar image

TimM
979


2 Answers:
public class Upgrader : UpgradeHandler
    {
        /// <summary>
        /// Determines whether this handler can upgrade the assembly
        ///             from the specified version of it.
        /// </summary>
        /// <param name="oldVersion">The old assembly version.</param>
        /// <returns>
        /// <see langword="true"/> if this instance can upgrade 
        ///             from the specified version of an old assembly; 
        ///             otherwise, <see langword="false"/>.
        /// </returns>
        public override bool CanUpgradeFrom(string oldVersion)
        {
            //return oldVersion.StartsWith("3.0.0");
            return true;
        }
    }

answered Jun 23 '11 at 03:43

xumix's gravatar image

xumix
37134573

You are right, I was a bit hasty.

(Jun 23 '11 at 04:23) olorin olorin's gravatar image

You need to create an UpgradeHandler class for your assembly.

The details are in the manual (URL http://help.dataobjects.net/##DataObjects.Net%20v4.4/html/34aeb6cd-61e8-4db2-88f8-1eff2031f103.htm )

In your case you will need just an empty upgrade handler.

public class Upgrader : UpgradeHandler
{

}

answered Jun 22 '11 at 03:56

olorin's gravatar image

olorin
3505084

reverted Jun 22 '11 at 05:17

Dmitri%20Maximov's gravatar image

Dmitri Maximov
1901211

I thought it would work, but the same issue remained.

I put the UpgradeMode to Recreate, ran the app : worked.

Then put it back to 'Perform', made sure the assembly version increased, and again it tells me that the upgrade is not supported.

I do have the code posted above in my project now, and still the issue remains.

Any other ideas?

(Jun 22 '11 at 14:42) TimM TimM's gravatar image

See xumix answer : I have forgotten an important part!

(Jun 23 '11 at 04:24) olorin olorin's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA