This repository was archived by the owner on May 31, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 168
This repository was archived by the owner on May 31, 2019. It is now read-only.
Program does not contain a static 'Main' method suitable for an entry point #401
Copy link
Copy link
Closed
Labels
closed-externalClosed because the issue is external to the project in this repo.Closed because the issue is external to the project in this repo.
Description
Hi,
Environment :
Centos 7.3
Docker version 17.09.0-ce, build afdb6d4
microsoft/aspnetcore-build docker image, pulled just now using docker pull microsoft/aspnetcore-build
I have two projects in solution.
demo.csproj default asp.net mvc project set up by vs 2017 community
Library.csproj default library project set up by vs 2017 community
Demo project reference the Library project.
Here is my dockerfile:
FROM microsoft/aspnetcore-build AS builder
WORKDIR /sln
COPY ./demo.sln ./
COPY ./demo/demo.csproj ./demo/demo.csproj
COPY ./Library/Library.csproj ./Library/Library.csproj
RUN dotnet restore
RUN dotnet build -c Release --no-restore
RUN dotnet publish "./demo/demo.csproj" -c Release -o "../dist" --no-restore
FROM microsoft/aspnetcore
WORKDIR /app
COPY --from=builder /sln/dist .
ENTRYPOINT ["dotnet", "demo.dll"]
Here is my docker command:
docker build /site/test -t aspnetapp
Here is the output:
[root@worth ~]# docker build /site/test -t aspnetapp
Sending build context to Docker daemon 5.083MB
Step 1/12 : FROM microsoft/aspnetcore-build AS builder
---> 244f6193d21a
Step 2/12 : WORKDIR /sln
---> Using cache
---> 44b558ba58b0
Step 3/12 : COPY ./demo.sln ./
---> 7dfd84d431b9
Step 4/12 : COPY ./demo/demo.csproj ./demo/demo.csproj
---> e8e751c2bca7
Step 5/12 : COPY ./Library/Library.csproj ./Library/Library.csproj
---> b0a979746fdf
Step 6/12 : RUN dotnet restore
---> Running in 5dabe8ff613f
Restoring packages for /sln/Library/Library.csproj...
Restoring packages for /sln/demo/demo.csproj...
Generating MSBuild file /sln/Library/obj/Library.csproj.nuget.g.props.
Generating MSBuild file /sln/Library/obj/Library.csproj.nuget.g.targets.
Restore completed in 718.77 ms for /sln/Library/Library.csproj.
Restoring packages for /sln/demo/demo.csproj...
Restore completed in 3.46 sec for /sln/demo/demo.csproj.
Generating MSBuild file /sln/demo/obj/demo.csproj.nuget.g.props.
Generating MSBuild file /sln/demo/obj/demo.csproj.nuget.g.targets.
Restore completed in 5.91 sec for /sln/demo/demo.csproj.
---> 75c5eb8d871e
Removing intermediate container 5dabe8ff613f
Step 7/12 : RUN dotnet build -c Release --no-restore
---> Running in 40ee491a3603
Microsoft (R) Build Engine version 15.6.82.30579 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Library -> /sln/Library/bin/Release/netcoreapp2.0/Library.dll
CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [/sln/demo/demo.csproj]
Build FAILED.
CSC : error CS5001: Program does not contain a static 'Main' method suitable for an entry point [/sln/demo/demo.csproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:06.10
The command '/bin/sh -c dotnet build -c Release --no-restore' returned a non-zero code: 1
FieldMarshallVague
Metadata
Metadata
Assignees
Labels
closed-externalClosed because the issue is external to the project in this repo.Closed because the issue is external to the project in this repo.