sougatamondal / migratordotnet

Automatically exported from code.google.com/p/migratordotnet
0 stars 0 forks source link

Invalid argument 'index' : Index was out of range. Must be non-negative and less han the size of the collection. #59

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a new Migration project
2. Create a new migration
3. Run migrator from the console (I know this is naughty but I am just 
getting started!)
4. Get the error as given in the summary

I am running the latest build of Migrator.NET and the error occurs in the 
constructor of MigrateAnywhere

        public MigrateAnywhere(List<long> availableMigrations, 
ITransformationProvider provider, ILogger logger)
            : base(availableMigrations, provider, logger)
        {
            _current = 0;
            if (_availableMigrations.Count > 0) {
                _current = provider.AppliedMigrations
[provider.AppliedMigrations.Count - 1];
            }
            _goForward = false;
        }

I fixed it temporarily changint the condition to

if (provider.AppliedMigrations.Count > 0) {
    _current = provider.AppliedMigrations
[provider.AppliedMigrations.Count - 1];

Not sure if this is the problem though as I have only just got started 
with browsing and understanding architecture.

Fluxtah

Original issue reported on code.google.com by flux...@gmail.com on 26 Aug 2008 at 2:07

GoogleCodeExporter commented 8 years ago
This is a duplicate of this one.
http://code.google.com/p/migratordotnet/issues/detail?id=54

Original comment by simone.b...@gmail.com on 27 Aug 2008 at 4:08

GoogleCodeExporter commented 8 years ago
Duplicates: Issue 54

Original comment by geoffl...@gmail.com on 27 Aug 2008 at 4:45