LinuxDoku / migratordotnet

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

Method 'Started' in type 'Migrator.MSBuild.Logger.TaskLogger' does not have an implementation. #89

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. svn checkout (bins on the download page are woefully out of date, and
don't match the documentation e.g. ScriptFile is not supported)
2. run build.bat (succeeds apart from some local properties missing warning)
3. Copy contents of build to my Source/ThirdParty dir
4. try to use the bins in a msbuild script:

  <PropertyGroup>
    <MigratorTasksPath>E:\Dev\XYZ\Main\Source\ThirdParty</MigratorTasksPath>
  </PropertyGroup>

  <Import Project="..\Source\ThirdParty\Migrator.Targets" />

  <Target Name="MigrationScript">
    <Migrate Provider="SqlServer"
        Connectionstring="Data Source=localhost; Database=XYZ; Integrated
Security=SSPI;"

Migrations="..\Source\XYZ.DatabaseMigrations\bin\Debug\XYZ.DatabaseMigrations.dl
l"
        Directory="."
        ScriptFile="MigrationScript.sql"/>
  </Target>

MSBuild output:

Microsoft (R) Build Engine Version 3.5.30729.1
[Microsoft .NET Framework, Version 2.0.50727.3053]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

Build started 1/30/2009 12:40:21 PM.
Project "E:\Dev\XYZ\Main\BuildScripts\CreateDatabaseMi
grationScript.proj" on node 0 (default targets).
E:\Dev\XYZ\Main\BuildScripts\CreateDatabaseMigrationSc
ript.proj(12,5): error MSB4062: The "Migrator.MSBuild.Migrate" task could not b
e loaded from the assembly E:\Dev\XYZ\Main\Source\Thir
dParty\Migrator.MSBuild.dll. Method 'Started' in type 'Migrator.MSBuild.Logger.
TaskLogger' from assembly 'Migrator.MSBuild, Version=0.7.0.21798, Culture=neutr
al, PublicKeyToken=null' does not have an implementation. Confirm that the <Usi
ngTask> declaration is correct, and that the assembly and all its dependencies
are available.
Done Building Project "E:\Dev\XYZ\Main\BuildScripts\Cr
eateDatabaseMigrationScript.proj" (default targets) -- FAILED.

Build FAILED.

"E:\Dev\XYZ\Main\BuildScripts\CreateDatabaseMigrationS
cript.proj" (default target) (1) ->
(MigrationScript target) ->
  E:\Dev\XYZ\Main\BuildScripts\CreateDatabaseMigration
Script.proj(12,5): error MSB4062: The "Migrator.MSBuild.Migrate" task could not
 be loaded from the assembly E:\Dev\XYZ\Main\Source\Th
irdParty\Migrator.MSBuild.dll. Method 'Started' in type 'Migrator.MSBuild.Logge
r.TaskLogger' from assembly 'Migrator.MSBuild, Version=0.7.0.21798, Culture=neu
tral, PublicKeyToken=null' does not have an implementation. Confirm that the <U
singTask> declaration is correct, and that the assembly and all its dependencie
s are available.

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.04

What version of the product are you using? On what operating system? With
what .NET implementation/version?

Microsoft Windows Server 2008
.NET 3.5 x64 (MSBuild 3.5 x64)
Visual Studio 2009

Original issue reported on code.google.com by rdingw...@gmail.com on 29 Jan 2009 at 11:45

GoogleCodeExporter commented 8 years ago
I just made one minor change - changed the To field to a Long as it should have 
been. 
But the Logger didn't change.

Either way, I wasn't able to reproduce this.

One thing - remove the Directory part. That is if you want to have the Migrate 
task 
compile your Migrations in memory. (Which I don't think currently is working 
with the 
MSBuild task).

Original comment by geoffl...@gmail.com on 9 Feb 2009 at 11:07

GoogleCodeExporter commented 8 years ago
I got this error too.  It was because I built the project with the .NET 3.5 
msbuild.
 To fix it, change line 108 of default.build so that the build will compile
Migrator.MSBuild.dll with .net 3.5 as well as .net 2.0:

line 108 used to be:
<csc target="library" output="${dir.bin}/Migrator.MSBuild.dll" 
define="${defines}"
debug="${debug}" if="${framework::get-target-framework() == 'net-2.0'">

should be:
<csc target="library" output="${dir.bin}/Migrator.MSBuild.dll" 
define="${defines}"
debug="${debug}" if="${framework::get-target-framework() == 'net-2.0' or
framework::get-target-framework() == 'net-3.5'}">

After changing that, the Migrator.MSBuild.dll was produced from running 
build.bat,
and the MSBuild migration task worked.

I noticed that there is a property called DOTNET2 which checks for either 
version of
the framework, but it doesn't seem to be used.

Original comment by lance.fi...@gmail.com on 13 Feb 2009 at 6:52

GoogleCodeExporter commented 8 years ago
SVN 130
Thanks for finding that Lance, it should be fixed now.

The DOTNET2 was a define (to using in #if conditions in the code)
I made a property called mono and a property called dotnet that could be 
checked in various places to see if they 
were defined, so I think that should fix the. Please confirm.

Original comment by geoffl...@gmail.com on 14 Feb 2009 at 7:51

GoogleCodeExporter commented 8 years ago
Working sweet now, thanks

Original comment by rdingw...@gmail.com on 15 Feb 2009 at 3:14