gpt4 book ai didi

c# - 无法生成:Microsoft/aspnetcore的 list :2.1找不到Visual Studio 7.5.2 Mac OS X

转载 作者:行者123 更新时间:2023-12-02 21:16:14 25 4
gpt4 key购买 nike

我已经在Mac OS X中使用Visual Studio 7.5.2创建了一个Asp.net 2.1 Web API项目。我向该项目添加了docker支持,但是在构建时,该项目不断出现错误,指出:failed to build: manifest for microsoft/aspnetcore:2.1 not found.

项目的Docker文件

FROM microsoft/aspnetcore:2.1 AS base
WORKDIR /app
EXPOSE 80

FROM microsoft/aspnetcore-build:2.1 AS build
WORKDIR /src
COPY MeroRentalDev.sln ./
COPY Auth.API/Auth.API.csproj Auth.API/
RUN dotnet restore -nowarn:msb3202,nu1503
COPY . .
WORKDIR /src/Auth.API
RUN dotnet build -c Release -o /app

FROM build AS publish
RUN dotnet publish -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "Auth.API.dll"]

dockerfile.yml
version: '3.4'

services:
auth.api:
image: auth
build:
context: .
dockerfile: Auth.API/Dockerfile

完整的错误详细信息
Building: docker-compose (Debug)
Build started 8/06/2018 3:05:13 PM.
__________________________________________________
Project "/Users/macbook/Projects/MeroRentalDev/docker-compose.dcproj" (Build target(s)):

Target DockerResolveAppType:
__________________________________________________
Project "/Users/macbook/Projects/MeroRentalDev/docker-compose.dcproj" is building "/Users/macbook/Projects/MeroRentalDev/Auth.API/Auth.API.csproj" (DockerResolveAppType target(s)):

Target DockerResolveTargetFramework:
__________________________________________________
Project "/Users/macbook/Projects/MeroRentalDev/docker-compose.dcproj" is building "/Users/macbook/Projects/MeroRentalDev/Auth.API/Auth.API.csproj" (DockerResolveTargetFramework target(s)):

Target DockerResolveProjectInputAndOutput:
__________________________________________________
Project "/Users/macbook/Projects/MeroRentalDev/docker-compose.dcproj" is building "/Users/macbook/Projects/MeroRentalDev/Auth.API/Auth.API.csproj" (DockerResolveProjectInputAndOutput target(s)):

Target DockerPrepareForBuild:
docker ps --filter "status=running" --filter "name=dockercompose763682937431840732_auth.api_" --format {{.ID}} -n 1
Target DockerBuildServiceReferences:
__________________________________________________
Project "/Users/macbook/Projects/MeroRentalDev/docker-compose.dcproj" is building "/Users/macbook/Projects/MeroRentalDev/Auth.API/Auth.API.csproj" (Build target(s)):

Target _HandlePackageFileConflicts:
Encountered conflict between 'Reference:/usr/local/share/dotnet/sdk/NuGetFallbackFolder/microsoft.netcore.app/2.1.0/ref/netcoreapp2.1/System.Collections.Immutable.dll' and 'Reference:/Users/macbook/.nuget/packages/system.collections.immutable/1.5.0/lib/netstandard2.0/System.Collections.Immutable.dll'. Choosing 'Reference:/usr/local/share/dotnet/sdk/NuGetFallbackFolder/microsoft.netcore.app/2.1.0/ref/netcoreapp2.1/System.Collections.Immutable.dll' because it comes from a package that is preferred.
Encountered conflict between 'Reference:/usr/local/share/dotnet/sdk/NuGetFallbackFolder/microsoft.netcore.app/2.1.0/ref/netcoreapp2.1/System.Diagnostics.DiagnosticSource.dll' and 'Reference:/Users/macbook/.nuget/packages/system.diagnostics.diagnosticsource/4.5.0/lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll'. Choosing 'Reference:/usr/local/share/dotnet/sdk/NuGetFallbackFolder/microsoft.netcore.app/2.1.0/ref/netcoreapp2.1/System.Diagnostics.DiagnosticSource.dll' because it comes from a package that is preferred.
Encountered conflict between 'Reference:/usr/local/share/dotnet/sdk/NuGetFallbackFolder/microsoft.netcore.app/2.1.0/ref/netcoreapp2.1/System.Reflection.Metadata.dll' and 'Reference:/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.reflection.metadata/1.6.0/lib/netstandard2.0/System.Reflection.Metadata.dll'. Choosing 'Reference:/usr/local/share/dotnet/sdk/NuGetFallbackFolder/microsoft.netcore.app/2.1.0/ref/netcoreapp2.1/System.Reflection.Metadata.dll' because it comes from a package that is preferred.
Encountered conflict between 'Reference:/usr/local/share/dotnet/sdk/NuGetFallbackFolder/microsoft.netcore.app/2.1.0/ref/netcoreapp2.1/System.Runtime.Serialization.Xml.dll' and 'Reference:/Users/macbook/.nuget/packages/system.runtime.serialization.xml/4.3.0/ref/netstandard1.3/System.Runtime.Serialization.Xml.dll'. Choosing 'Reference:/usr/local/share/dotnet/sdk/NuGetFallbackFolder/microsoft.netcore.app/2.1.0/ref/netcoreapp2.1/System.Runtime.Serialization.Xml.dll' because AssemblyVersion '4.1.4.0' is greater than '4.1.1.0'.
Encountered conflict between 'Platform:Microsoft.Win32.Registry.dll' and 'Runtime:/usr/local/share/dotnet/sdk/NuGetFallbackFolder/microsoft.win32.registry/4.5.0/lib/netstandard2.0/Microsoft.Win32.Registry.dll'. Choosing 'Platform:Microsoft.Win32.Registry.dll' because it comes from a package that is preferred.
Encountered conflict between 'Platform:System.Collections.Immutable.dll' and 'Runtime:/Users/macbook/.nuget/packages/system.collections.immutable/1.5.0/lib/netstandard2.0/System.Collections.Immutable.dll'. Choosing 'Platform:System.Collections.Immutable.dll' because it comes from a package that is preferred.
Encountered conflict between 'Platform:System.Diagnostics.DiagnosticSource.dll' and 'Runtime:/Users/macbook/.nuget/packages/system.diagnostics.diagnosticsource/4.5.0/lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll'. Choosing 'Platform:System.Diagnostics.DiagnosticSource.dll' because it comes from a package that is preferred.
Encountered conflict between 'Platform:System.Reflection.Metadata.dll' and 'Runtime:/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.reflection.metadata/1.6.0/lib/netstandard2.0/System.Reflection.Metadata.dll'. Choosing 'Platform:System.Reflection.Metadata.dll' because it comes from a package that is preferred.
Encountered conflict between 'Platform:System.Runtime.Serialization.Xml.dll' and 'Runtime:/Users/macbook/.nuget/packages/system.runtime.serialization.xml/4.3.0/lib/netstandard1.3/System.Runtime.Serialization.Xml.dll'. Choosing 'Platform:System.Runtime.Serialization.Xml.dll' because AssemblyVersion '4.1.4.0' is greater than '4.1.2.0'.
Encountered conflict between 'Platform:System.Security.AccessControl.dll' and 'Runtime:/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.security.accesscontrol/4.5.0/lib/netstandard2.0/System.Security.AccessControl.dll'. Choosing 'Platform:System.Security.AccessControl.dll' because it comes from a package that is preferred.
Encountered conflict between 'Platform:System.Security.Cryptography.Cng.dll' and 'Runtime:/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.security.cryptography.cng/4.5.0/lib/netcoreapp2.1/System.Security.Cryptography.Cng.dll'. Choosing 'Platform:System.Security.Cryptography.Cng.dll' because it comes from a package that is preferred.
Encountered conflict between 'Platform:System.Security.Principal.Windows.dll' and 'Runtime:/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.security.principal.windows/4.5.0/lib/netstandard2.0/System.Security.Principal.Windows.dll'. Choosing 'Platform:System.Security.Principal.Windows.dll' because it comes from a package that is preferred.
Encountered conflict between 'Platform:Microsoft.Win32.Registry.dll' and 'Runtime:/usr/local/share/dotnet/sdk/NuGetFallbackFolder/microsoft.win32.registry/4.5.0/runtimes/unix/lib/netstandard2.0/Microsoft.Win32.Registry.dll'. Choosing 'Platform:Microsoft.Win32.Registry.dll' because it comes from a package that is preferred.
Encountered conflict between 'Platform:Microsoft.Win32.Registry.dll' and 'Runtime:/usr/local/share/dotnet/sdk/NuGetFallbackFolder/microsoft.win32.registry/4.5.0/runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.dll'. Choosing 'Platform:Microsoft.Win32.Registry.dll' because it comes from a package that is preferred.
Encountered conflict between 'Platform:System.Security.AccessControl.dll' and 'Runtime:/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.security.accesscontrol/4.5.0/runtimes/win/lib/netcoreapp2.0/System.Security.AccessControl.dll'. Choosing 'Platform:System.Security.AccessControl.dll' because it comes from a package that is preferred.
Encountered conflict between 'Platform:System.Security.Cryptography.Cng.dll' and 'Runtime:/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.security.cryptography.cng/4.5.0/runtimes/win/lib/netcoreapp2.1/System.Security.Cryptography.Cng.dll'. Choosing 'Platform:System.Security.Cryptography.Cng.dll' because it comes from a package that is preferred.
Encountered conflict between 'Platform:System.Security.Principal.Windows.dll' and 'Runtime:/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.security.principal.windows/4.5.0/runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.dll'. Choosing 'Platform:System.Security.Principal.Windows.dll' because it comes from a package that is preferred.
Encountered conflict between 'Platform:System.Security.Principal.Windows.dll' and 'Runtime:/usr/local/share/dotnet/sdk/NuGetFallbackFolder/system.security.principal.windows/4.5.0/runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.dll'. Choosing 'Platform:System.Security.Principal.Windows.dll' because it comes from a package that is preferred.
Target GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
Target _CoreGenerateRazorAssemblyInfo:
Skipping target "_CoreGenerateRazorAssemblyInfo" because all output files are up-to-date with respect to the input files.
Target CoreGenerateAssemblyInfo:
Skipping target "CoreGenerateAssemblyInfo" because all output files are up-to-date with respect to the input files.
Target CoreCompile:
Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
Target GenerateBuildDependencyFile:
Skipping target "GenerateBuildDependencyFile" because all output files are up-to-date with respect to the input files.
Target GenerateBuildRuntimeConfigurationFiles:
Skipping target "GenerateBuildRuntimeConfigurationFiles" because all output files are up-to-date with respect to the input files.
Target CopyFilesToOutputDirectory:
Auth.API -> /Users/macbook/Projects/MeroRentalDev/Auth.API/bin/Debug/netcoreapp2.1/Auth.API.dll
Target DockerUpdateComposeVsGeneratedFiles:
__________________________________________________
Project "/Users/macbook/Projects/MeroRentalDev/docker-compose.dcproj" is building "/Users/macbook/Projects/MeroRentalDev/Auth.API/Auth.API.csproj" (DockerUpdateComposeVsGeneratedFiles target(s)):

Copying file from "/Users/macbook/Projects/MeroRentalDev/obj/Docker/docker-compose.vs.debug.partial.g.yml" to "/Users/macbook/Projects/MeroRentalDev/obj/Docker/docker-compose.vs.debug.g.yml".
Copying file from "/Users/macbook/Projects/MeroRentalDev/obj/Docker/docker-compose.vs.release.partial.g.yml" to "/Users/macbook/Projects/MeroRentalDev/obj/Docker/docker-compose.vs.release.g.yml".
Target DockerPrepareForLaunch:
docker-compose -f "/Users/macbook/Projects/MeroRentalDev/docker-compose.yml" -f "/Users/macbook/Projects/MeroRentalDev/docker-compose.override.yml" -f "/Users/macbook/Projects/MeroRentalDev/obj/Docker/docker-compose.vs.debug.g.yml" -p dockercompose763682937431840732 --no-ansi up -d --build --force-recreate --remove-orphans
Building auth.api
Step 1/3 : FROM microsoft/aspnetcore:2.1 AS base
Service 'auth.api' failed to build: manifest for microsoft/aspnetcore:2.1 not found
/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/docker/MonoDevelop.Docker/MSbuild/Sdks/Microsoft.Docker.Sdk/build/Microsoft.VisualStudio.Docker.Compose.targets(363,5): error : Building auth.api
/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/docker/MonoDevelop.Docker/MSbuild/Sdks/Microsoft.Docker.Sdk/build/Microsoft.VisualStudio.Docker.Compose.targets(363,5): error : Service 'auth.api' failed to build: manifest for microsoft/aspnetcore:2.1 not found.
/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/docker/MonoDevelop.Docker/MSbuild/Sdks/Microsoft.Docker.Sdk/build/Microsoft.VisualStudio.Docker.Compose.targets(363,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(363,5): error : For more troubleshooting information, go to http://aka.ms/DockerToolsTroubleshooting
Done building target "DockerPrepareForLaunch" in project "docker-compose.dcproj" -- FAILED.

Done building project "docker-compose.dcproj" -- FAILED.

Build FAILED.

/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/docker/MonoDevelop.Docker/MSbuild/Sdks/Microsoft.Docker.Sdk/build/Microsoft.VisualStudio.Docker.Compose.targets(363,5): error : Building auth.api
/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/docker/MonoDevelop.Docker/MSbuild/Sdks/Microsoft.Docker.Sdk/build/Microsoft.VisualStudio.Docker.Compose.targets(363,5): error : Service 'auth.api' failed to build: manifest for microsoft/aspnetcore:2.1 not found.
/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/docker/MonoDevelop.Docker/MSbuild/Sdks/Microsoft.Docker.Sdk/build/Microsoft.VisualStudio.Docker.Compose.targets(363,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(363,5): error : For more troubleshooting information, go to http://aka.ms/DockerToolsTroubleshooting
0 Warning(s)
1 Error(s)

Time Elapsed 00:00:07.03

---------------------- Done ----------------------

Build: 1 error, 0 warnings

我从这些链接尝试了一些解决方案:

AspNetCore:2.1 not found

Cannot run Dot net core preview project on Docker

我使用以下命令将Docker镜像更新为最新版本,但仍然存在相同的问题。
Pulling from microsoft/dotnet

Pulling from microsoft/aspnetcore-build

最佳答案

找到了解决方案,但不确定这是正确的解决方案。链接-https://hub.docker.com/r/microsoft/aspnetcore/

如下更改docker文件

删除microsoft / aspnetcore-build:2.1到microsoft / aspnetcore-build

FROM microsoft/aspnetcore-build AS base
WORKDIR /app
EXPOSE 80

FROM microsoft/aspnetcore-build AS build
WORKDIR /src
COPY MeroRentalDev.sln ./
COPY Auth.API/Auth.API.csproj Auth.API/
RUN dotnet restore -nowarn:msb3202,nu1503
COPY . .
WORKDIR /src/Auth.API
RUN dotnet build -c Release -o /app

FROM build AS publish
RUN dotnet publish -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "Auth.API.dll"]

ASP.NET Core运行时Docker镜像
该存储库包含用于运行已发布的ASP.NET Core应用程序的图像。这些镜像仅包含运行时。使用microsoft / aspnetcore-build在容器内构建ASP.NET Core应用。

关于c# - 无法生成:Microsoft/aspnetcore的 list :2.1找不到Visual Studio 7.5.2 Mac OS X,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50753727/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com