Mapster icon indicating copy to clipboard operation
Mapster copied to clipboard

Running Mapper Generation in Docker

Open doddi321 opened this issue 3 years ago • 0 comments

I'm trying to use the generation tool to generate my mapper interfaces but every time I try to build my docker image I get an error.

System.IO.FileNotFoundException

#15 11.31 Restored /src/Application/Application.csproj (in 9.61 sec). #15 11.31 Restored /src/WebApplication1/WebApplication1.csproj (in 9.61 sec). #15 13.12 Application -> /app/build/Application.dll #15 15.27 Tool 'mapster.tool' (version '8.3.0') was restored. Available commands: dotnet-mapster #15 15.27 #15 15.27 Restore was successful. #15 15.70 Cannot find assembly path: FluentValidation (type=package, version=11.1.0) #15 15.71 Unhandled exception. System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. #15 15.71 Could not load file or assembly 'FluentValidation, Version=11.0.0.0, Culture=neutral, PublicKeyToken=7de548da2fbae0f0'. The system cannot find the file specified. #15 15.71 #15 15.71 at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) #15 15.71 at System.Reflection.Assembly.GetTypes() #15 15.71 at Mapster.Tool.Extensions.Scan(CodeGenerationConfig config, Assembly assembly) in C:\Projects\Mapster\src\Mapster.Tool\Extensions.cs:line 177 #15 15.71 at Mapster.Tool.Program.GenerateModels(ModelOptions opt) in C:\Projects\Mapster\src\Mapster.Tool\Program.cs:line 146 #15 15.71 at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult1 result, Action1 action) #15 15.71 at Mapster.Tool.Program.Main(String[] args) in C:\Projects\Mapster\src\Mapster.Tool\Program.cs:line 17 #15 15.71 System.IO.FileNotFoundException: Could not load file or assembly 'FluentValidation, Version=11.0.0.0, Culture=neutral, PublicKeyToken=7de548da2fbae0f0'. The system cannot find the file specified. #15 15.71 #15 15.71 File name: 'FluentValidation, Version=11.0.0.0, Culture=neutral, PublicKeyToken=7de548da2fbae0f0' #15 15.72 /src/Application/Application.csproj(11,3): error MSB3073: The command "dotnet mapster model -a "/app/build/Application.dll"" exited with code 134. #15 15.73 #15 15.73 Build FAILED. #15 15.73 #15 15.73 /src/Application/Application.csproj(11,3): error MSB3073: The command "dotnet mapster model -a "/app/build/Application.dll"" exited with code 134. #15 15.73 0 Warning(s) #15 15.73 1 Error(s)

I have a WebApplication1 project that depends on Application and the Application contains the mapper logic, I'm trying to build the image for WebApplication1.

doddi321 avatar Jul 22 '22 15:07 doddi321