.Net Core 项目 打包成一个单独的可执行exe文件,无法打包bin/Debug/下的exe文件
我的项目调用了一个exe文件,然后在打包发布成一个单独的可执行文件时,无法将调用的那个exe文件打包进来……
windows10.0.17763.0\publish\win-x64'. 系统找不到指定的文件。
这个exe,是个控制台参数文件,需要通过cmd进行使用,我把他封装成了个WinForm的东西,在打包的时候发现bin下面粘贴进去的这个exe无法进行打包
打包配置文件
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration>Debug</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Debug\net6.0-windows10.0.17763.0\publish\win-x64\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net6.0-windows10.0.17763.0</TargetFramework>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishReadyToRun>False</PublishReadyToRun>
<PublishTrimmed>True</PublishTrimmed>
<PublishSingleFile>True</PublishSingleFile>
</PropertyGroup>
</Project>
回答
试试在 .csproj 中包含一下这个 exe 文件
THE END
二维码