.net core 如何永久删除.net核心应用程序中的源代码引用

.net core 如何永久删除.net核心应用程序中的源代码引用,.net-core,dockerfile,debug-symbols,.net Core,Dockerfile,Debug Symbols,我有一个在发行版中编译的.net核心应用程序。我假设没有任何可用的源信息 但我看到了一个例外: Unhandled exception. System.Exception: can't download the license data at Common.Credentials.RequestCredentials[a](a licenseId) in /src/Weatherman/Common/Credentials.fs:line 71 因此,文件名和行以某种方式与应用程序捆绑在

我有一个在发行版中编译的.net核心应用程序。我假设没有任何可用的源信息

但我看到了一个例外:

Unhandled exception. System.Exception: can't download the license data
   at Common.Credentials.RequestCredentials[a](a licenseId) in /src/Weatherman/Common/Credentials.fs:line 71
因此,文件名和行以某种方式与应用程序捆绑在一起

构建是这样完成的(通过dockerfile):


所以我真的认为不会留下任何调试信息。如何修复此问题?

您可以将项目配置为不生成调试信息。您可以将其添加到所有项目文件中,或添加到:


没有一个
假的

查看更多详细信息,请访问

您是否在发布目录
/app
中看到任何pdb文件?移除它们会有不同吗?你是对的!我从来没有想过它会把pdb文件与发布功能!我现在必须弄清楚如何确保它们不是内置在发行版中,我没有启用符号:但这将阻止在调试中内置符号,对吗?
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 as build

WORKDIR /src/
COPY ./Weatherman/Common/Common.fsproj                   ./Weatherman/Common/Common.fsproj
COPY ./Weatherman/Exchange/Exchange.fsproj               ./Weatherman/Exchange/Exchange.fsproj
COPY ./Services/Connector/Connector.fsproj ./Services/Connector/Connector.fsproj
RUN dotnet restore Services/Connector/Connector.fsproj

COPY . /src/
RUN dotnet build --nologo -c Release -o /app --no-restore Services/Connector/Connector.fsproj

FROM build AS publish
RUN dotnet publish --nologo -c Release -o /app --no-restore Services/Connector/Connector.fsproj

FROM mcr.microsoft.com/dotnet/core/runtime:3.1 as final

WORKDIR /app
COPY --from=publish /app .