Hey everyone,
In a nutshell, I have a Docker app containing three micro-services (one for connecting to SQL Server DB, another to PostgreSQL and another is just a Web API that serves a MVC app). Everything is working fine on Windows (with a Docker Linux host), however it fails miserably on Mac on Visual Studio and .NET Core 2.0. I can successfully build and run all projects individually, but I can't seem to start the docker-compose project.
Apparently, there's an exception being raised because the DataProtection dll is not being loaded. Note that I'mnot using Data Protection, so it comes at odds that it is trying to load DataProtection. Anyways, here's the stack trace. Any help would be very much appreciated. Thank you!
---> Running in 2a59f19dab8b
Microsoft (R) Build Engine version 15.5.180.51428 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 47.7 ms for /src/CHVNG/CHVNG.csproj.
Restore completed in 32.57 ms for /src/CHVNG/CHVNG.csproj.
CHVNG -> /src/CHVNG/bin/Release/netcoreapp2.0/CHVNG.dll
Could not load file or assembly 'Microsoft.AspNetCore.DataProtection, Version=2.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. An attempt was made to load a program with an incorrect format.
at Microsoft.Extensions.DependencyInjection.MvcViewFeaturesMvcCoreBuilderExtensions.AddViewServices(IServiceCollection services)
at Microsoft.Extensions.DependencyInjection.MvcViewFeaturesMvcCoreBuilderExtensions.AddViews(IMvcCoreBuilder builder)
at Microsoft.Extensions.DependencyInjection.MvcRazorMvcCoreBuilderExtensions.AddRazorViewEngine(IMvcCoreBuilder builder)
at Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal.MvcServiceProvider.GetProvider(IDesignTimeMvcBuilderConfiguration mvcBuilderConfiguration)
at Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal.MvcServiceProvider..ctor(String projectPath, String applicationName, String contentRoot, String configureCompilationType)
at Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal.PrecompileRunCommand.Execute()
at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
at Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal.PrecompilationApplication.Execute(String[] args)
/usr/share/dotnet/sdk/NuGetFallbackFolder/microsoft.aspnetcore.mvc.razor.viewcompilation/2.0.2/build/netstandard2.0/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.targets(60,5): error MSB3073: The command ""/usr/share/dotnet/dotnet" exec --runtimeconfig "/src/CHVNG/bin/Release/netcoreapp2.0/CHVNG.runtimeconfig.json"
--depsfile "/src/CHVNG/bin/Release/netcoreapp2.0/CHVNG.deps.json" "/usr/share/dotnet/sdk/NuGetFallbackFolder/microsoft.aspnetcore.mvc.razor.viewcompilation/2.0.2/build/netstandard2.0/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.dll" @"obj/Release/netcoreapp2.0/microsoft.aspnetcore.mvc.razor.viewcompilation.rsp""
exited with code 1. [/src/CHVNG/CHVNG.csproj]
Service 'chvng' failed to build: The command '/bin/sh -c dotnet publish -c Release -o /app' returned a non-zero code: 1
/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/docker/MonoDevelop.Docker/MSbuild/Sdks/Microsoft.Docker.Sdk/build/Microsoft.VisualStudio.Docker.Compose.targets(346,5): error : Creating network "dockercompose8284073181206417583_default"
with the default driver
/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/docker/MonoDevelop.Docker/MSbuild/Sdks/Microsoft.Docker.Sdk/build/Microsoft.VisualStudio.Docker.Compose.targets(346,5): error : Building chvng
/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/docker/MonoDevelop.Docker/MSbuild/Sdks/Microsoft.Docker.Sdk/build/Microsoft.VisualStudio.Docker.Compose.targets(346,5): error : Service 'chvng' failed to build: The command '/bin/sh -c
dotnet publish -c Release -o /app' returned a non-zero code: 1.
/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/docker/MonoDevelop.Docker/MSbuild/Sdks/Microsoft.Docker.Sdk/build/Microsoft.VisualStudio.Docker.Compose.targets(346,5): error :
/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/docker/MonoDevelop.Docker/MSbuild/Sdks/Microsoft.Docker.Sdk/build/Microsoft.VisualStudio.Docker.Compose.targets(346,5): error : For more troubleshooting information, go to http://aka.ms/DockerToolsTroubleshooting
Done building target "DockerPrepareForLaunch" in project "docker-compose.dcproj" -- FAILED.