且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Docker容器中构建dotnet应用时找不到为Main方法指定的'xxx.Program'

更新时间:2023-11-18 16:07:46

我的问题的解决方案是从csproj文件中删除以下行:

The solution to my problem was to remove the following line from my csproj file:

<OutputType>EXE</OutputType>

似乎Visual Studio 2107在更改输出类型时会添加该标签。删除该代码后,便可以在Docker容器和Windows中构建和发布。

It seems like visual studio 2107 adds that tag when changing the output type. Once I removed that, I was able to build and publish inside a Docker Container and Windows.