Cauldron icon indicating copy to clipboard operation
Cauldron copied to clipboard

Works compiling from VisualStudio, fails compiling through dotnet command

Open thewazaa opened this issue 6 years ago • 3 comments

I have problems compiling a project using these weavers from command line:

With visual studio:

1>Target FodyTarget:
1>    Fody: Fody (version 3.2.10.0) Executing
1>    Fody: ProjectDirectory: 'C:\Repos\PlatformMicroServicePrototype\Platform\Logger'.
1>    Fody: AssemblyFile: 'C:\Repos\PlatformMicroServicePrototype\Platform\Logger\obj\Debug\netcoreapp2.2\Logger.dll'
1>    Fody: Found path to weavers file 'C:\Repos\PlatformMicroServicePrototype\Platform\Logger\FodyWeavers.xml'.
1>    Fody: SolutionDirectory path is 'C:\Repos\PlatformMicroServicePrototype\'
1>    Fody: Finding weavers
1>    Fody:   Scanning SolutionDir/Tools directory convention: 'C:\Repos\PlatformMicroServicePrototype\Tools'.
1>    Fody: No Weaver project file found.
1>    Fody: FindAddinDirectories (Legacy):
1>    Fody:   Skipped directory from Nuget Config since it could not be derived.
1>    Fody:   Scanning the MsBuildThisFileDirectory parent: C:\Users\user\.nuget\packages\'.
1>    Fody:   Scanning NuGetPackageRoot 'C:\Users\user\.nuget\packages\'.
1>    Fody: Searched for 'Cauldron.Interception'. Found: C:\Users\josep.pons.NEOIT\.nuget\packages\cauldron.interception.fody\3.2.3\netclassicweaver\Cauldron.Interception.Fody.dll

With command line: "dotnet build -v n"

 3>FodyTarget:
           Fody: SolutionDirectory path is 'C:\Repos\PlatformMicroServicePrototype\'
           Fody: Finding weavers
           Fody:   Scanning SolutionDir/Tools directory convention: 'C:\Repos\PlatformMicroServicePrototype\Tools'.
           Fody: No Weaver project file found.
           Fody: FindAddinDirectories (Legacy):
           Fody:   Skipped directory from Nuget Config since it could not be derived.
           Fody:   Scanning the MsBuildThisFileDirectory parent: C:\Users\user\.nuget\packages\'.
           Fody:   Scanning NuGetPackageRoot 'C:\Users\user\.nuget\packages\'.
     3>MSBUILD : error : Fody: Could not find a weaver named 'Cauldron.Interception'. [C:\Repos\PlatformMicroServicePrototype\Platform\Logger\Logger.csproj]
MSBUILD : error : If you have nuget package restore turned on you probably need to do a build to download the weavers. [C:\Repos\PlatformMicroServicePrototype\Platform\Logger\Logger.csproj]
MSBUILD : error : Alternatively you may have added a weaver to your 'FodyWeavers.xml' and forgot to add the appropriate NuGet package. [C:\Repos\PlatformMicroServicePrototype\Platform\Logger\Logger.csproj]
MSBUILD : error : This url may provide more information http://nuget.org/packages/Cauldron.Interception.Fody/ . [C:\Repos\PlatformMicroServicePrototype\Platform\Logger\Logger.csproj]
           Fody:   Finished Fody 338ms.

I'm quite lost regarding why this happens. The project is in netcore2.2, but I don't think it really matters cause with Visual Studio everything works.

thewazaa avatar Feb 06 '19 16:02 thewazaa

I am also having this issue, I have confirmed that it happens both on the latest DotNetCore on windows and also DotNetCore 2.2 on linux.

The project compiles and correctly weaves on Visual Studio 2019.

This is a blocking issue.

Error when running dotnet build is: MSBUILD : error : Fody: Could not find a weaver named 'Cauldron.Interception'

SirDragonClaw avatar May 28 '19 04:05 SirDragonClaw

Any update on this? I'm facing this same blocking issue. I'm able to restore + build + run from Visual Studio 2017, but the 'dotnet build' command is failing.

"dotnet build" output:

C:\[project path]>dotnet build
Microsoft (R) Build Engine version 16.0.450+ga8dc7f1d34 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 88.51 ms for C:\<target_project>.csproj.
    Fody: Fody (version 3.2.10.0) Executing
MSBUILD : error : Fody: Could not find a weaver named 'Cauldron.Interception'. [<target_project>.csproj]
MSBUILD : error : If you have nuget package restore turned on you probably need to do a build to download the weavers. [<target_project>.csproj]
MSBUILD : error : Alternatively you may have added a weaver to your 'FodyWeavers.xml' and forgot to add the appropriate NuGet package. [<target_project>.csproj]
MSBUILD : error : This url may provide more information http://nuget.org/packages/Cauldron.Interception.Fody/ . [<target_project>.csproj]
    Fody:   Finished Fody 136ms.

Build FAILED.

FodyWeavers.xml:

<Weavers VerifyAssembly="True">
  <Cauldron.Interception>
    <OnlyIncludeAssemblies>
      MyProject.
    </OnlyIncludeAssemblies>
  </Cauldron.Interception>
</Weavers>

I've got the following NuGet packages referenced in this project:

    <PackageReference Include="Capgemini.Cauldron" Version="3.2.3" />
    <PackageReference Include="Capgemini.Cauldron.Interceptors" Version="3.2.3" />
    <PackageReference Include="Cauldron.BasicInterceptors" Version="3.2.3" />
    <PackageReference Include="Cauldron.Interception.Fody" Version="3.2.3" />

htxryan avatar Aug 12 '19 15:08 htxryan

Related issue https://github.com/Capgemini/Cauldron/issues/84

Arlodotexe avatar Apr 26 '22 17:04 Arlodotexe