Open GoogleCodeExporter opened 9 years ago
This does work from NAnt.
Original comment by geoffl...@gmail.com
on 5 Sep 2008 at 10:46
This could be caused by a version conflict. if the migrations where built
against Migrator.Framework version 0.8.0.2941 but the msbuild task was built
against a later
version...
Original comment by michael.aird@gmail.com
on 1 Oct 2008 at 8:25
I'm having the same issue here and there isn't a version conflict. For some
reason
it's looking in C:/Windows/Microsoft.NET/Framework/v3.5/ for the
Migrator.Framework.dll
Building with tools version "2.0".
Target "Migrate: (TargetId:0)" in file "D:\TestProgram\build.proj" from
project "D:\TestProgram\build.proj":
Using "Message" task from assembly "Microsoft.Build.Tasks, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "Message" (TaskId:0)
Migrating (TaskId:0)
Done executing task "Message". (TaskId:0)
Using "CreateProperty" task from assembly "Microsoft.Build.Tasks,
Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "CreateProperty" (TaskId:1)
Done executing task "CreateProperty". (TaskId:1)
Using "Migrate" task from assembly "D:\TestProgram\lib\Migrator.MSBuild.dll".
Task "Migrate" (TaskId:2)
Compiling:
Domain\AddTestTable.cs
D:\TestProgram\build.proj(15,5): error MSB4018: The "Migrate" task failed
unexpectedly.
D:\TestProgram\build.proj(15,5): error MSB4018:
System.IO.FileNotFoundException:
Could not load file or assembly 'Migrator.Framework, Version=0.7.0.21797,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system
cannot
find the file specified.
D:\TestProgram\build.proj(15,5): error MSB4018: File name: 'Migrator.Framework,
Version=0.7.0.21797, Culture=neutral, PublicKeyToken=null'
D:\TestProgram\build.proj(15,5): error MSB4018: at
System.Reflection.Assembly._GetExportedTypes()
D:\TestProgram\build.proj(15,5): error MSB4018: at
System.Reflection.Assembly.GetExportedTypes()
D:\TestProgram\build.proj(15,5): error MSB4018: at
Migrator.MigrationLoader.GetMigrationTypes(Assembly asm)
D:\TestProgram\build.proj(15,5): error MSB4018: at
Migrator.MigrationLoader.AddMigrations(Assembly migrationAssembly)
D:\TestProgram\build.proj(15,5): error MSB4018: at
Migrator.MigrationLoader..ctor
(ITransformationProvider provider, Assembly migrationAssembly, Boolean trace)
D:\TestProgram\build.proj(15,5): error MSB4018: at Migrator.Migrator..ctor
(ITransformationProvider provider, Assembly migrationAssembly, Boolean trace,
ILogger logger)
D:\TestProgram\build.proj(15,5): error MSB4018: at
Migrator.Migrator..ctor(String
provider, String connectionString, Assembly migrationAssembly, Boolean trace,
ILogger logger)
D:\TestProgram\build.proj(15,5): error MSB4018: at
Migrator.MSBuild.Migrate.Execute(Assembly asm)
D:\TestProgram\build.proj(15,5): error MSB4018: at
Migrator.MSBuild.Migrate.Execute()
D:\TestProgram\build.proj(15,5): error MSB4018: at
Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy
engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task,
Boolean& taskResult)
D:\TestProgram\build.proj(15,5): error MSB4018:
D:\TestProgram\build.proj(15,5): error MSB4018: Assembly manager loaded from:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
D:\TestProgram\build.proj(15,5): error MSB4018: Running under executable
C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe
D:\TestProgram\build.proj(15,5): error MSB4018: --- A detailed error log
follows.
D:\TestProgram\build.proj(15,5): error MSB4018:
D:\TestProgram\build.proj(15,5): error MSB4018: === Pre-bind state information
===
D:\TestProgram\build.proj(15,5): error MSB4018: LOG: User = ARIAMEDIA\jseekamp
D:\TestProgram\build.proj(15,5): error MSB4018: LOG: DisplayName =
Migrator.Framework, Version=0.7.0.21797, Culture=neutral, PublicKeyToken=null
D:\TestProgram\build.proj(15,5): error MSB4018: (Fully-specified)
D:\TestProgram\build.proj(15,5): error MSB4018: LOG: Appbase =
file:///C:/Windows/Microsoft.NET/Framework/v3.5/
D:\TestProgram\build.proj(15,5): error MSB4018: LOG: Initial PrivatePath = NULL
D:\TestProgram\build.proj(15,5): error MSB4018: Calling assembly : (Unknown).
D:\TestProgram\build.proj(15,5): error MSB4018: ===
D:\TestProgram\build.proj(15,5): error MSB4018: LOG: This bind starts in
default
load context.
D:\TestProgram\build.proj(15,5): error MSB4018: LOG: Using application
configuration
file: C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe.Config
D:\TestProgram\build.proj(15,5): error MSB4018: LOG: Using machine
configuration
file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
D:\TestProgram\build.proj(15,5): error MSB4018: LOG: Policy not being applied
to
reference at this time (private, custom, partial, or location-based assembly
bind).
D:\TestProgram\build.proj(15,5): error MSB4018: LOG: Attempting download of new
URL
file:///C:/Windows/Microsoft.NET/Framework/v3.5/Migrator.Framework.DLL.
D:\TestProgram\build.proj(15,5): error MSB4018: LOG: Attempting download of new
URL
file:///C:/Windows/Microsoft.NET/Framework/v3.5/Migrator.Framework/Migrator.Fram
ework
.DLL.
D:\TestProgram\build.proj(15,5): error MSB4018: LOG: Attempting download of new
URL
file:///C:/Windows/Microsoft.NET/Framework/v3.5/Migrator.Framework.EXE.
D:\TestProgram\build.proj(15,5): error MSB4018: LOG: Attempting download of new
URL
file:///C:/Windows/Microsoft.NET/Framework/v3.5/Migrator.Framework/Migrator.Fram
ework
.EXE.
D:\TestProgram\build.proj(15,5): error MSB4018:
Done executing task "Migrate" -- FAILED. (TaskId:2)
Done building target "Migrate" in project "build.proj" -- FAILED.: (TargetId:0)
Done Building Project "D:\TestProgram\build.proj" (migrate target(s)) -- FAILED.
Original comment by jeremyse...@gmail.com
on 18 Dec 2008 at 12:17
Moving to Milestone 9
Original comment by geoffl...@gmail.com
on 14 Feb 2009 at 10:47
The problem appears to be that the working directory is not set to the lib
folder
where the MyMigrations.dll is put. To get it working until it's fixed try the
following:
1. Add a task to copy your migration dll to the Migrator lib folder
2. Use the following task to do the migration (replace <MigratorLibFolder>,
<ConnectString> and <MyMigrations.dll> with your setup
<Target Name="Migrate" DependsOnTargets="Build">
<CreateProperty Value="-1" Condition="'$(MigrationVersion)'==''">
<Output TaskParameter="Value" PropertyName="MigrationVersion" />
</CreateProperty>
<Exec WorkingDirectory="$(MSBuildProjectDirectory)\<MigratorLibFolder>"
Command="Migrator.Console.exe SqlServer "<ConnectString>"
<MyMigrations.dll> -version $(MigrationVersion)" />
</Target>
This setup works well in my environment.
Thanks for the great library. This + ASP.NET MVC is bringing us closer to
Rails for
the corporation every day!
Original comment by garth.wi...@gmail.com
on 17 Feb 2009 at 3:08
Original issue reported on code.google.com by
geoffl...@gmail.com
on 5 Sep 2008 at 10:46