File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9090 - name : Build solution
9191 run : dotnet build CanonSDK.sln --configuration Release --no-restore
9292
93- - name : Publish Canon.API
94- run : dotnet publish Canon.API --configuration Release --output ./publish --no-build
93+ - name : Publish Canon.API as standalone executable
94+ run : dotnet publish Canon.API/Canon.API.csproj --configuration Release --runtime win-x64 --self-contained true -p:PublishSingleFile=true --output ./publish
9595
9696 - name : Create release package
9797 run : |
Original file line number Diff line number Diff line change 55 <Nullable >enable</Nullable >
66 <ImplicitUsings >enable</ImplicitUsings >
77 <PlatformTarget >x64</PlatformTarget >
8-
8+
99 <!-- Assembly Version Configuration -->
1010 <AssemblyVersion >1.0.0.8</AssemblyVersion >
1111 <FileVersion >1.0.0.8</FileVersion >
1212 <Version >1.0.0.8</Version >
13+
14+ <!-- Self-Contained Single-File Deployment -->
15+ <PublishSingleFile >true</PublishSingleFile >
16+ <SelfContained >true</SelfContained >
17+ <RuntimeIdentifier >win-x64</RuntimeIdentifier >
18+ <IncludeNativeLibrariesForSelfExtract >true</IncludeNativeLibrariesForSelfExtract >
19+ <EnableCompressionInSingleFile >true</EnableCompressionInSingleFile >
1320 </PropertyGroup >
1421
1522 <ItemGroup >
Original file line number Diff line number Diff line change 4141 AutoUpdater . RunUpdateAsAdmin = false ; // Disable admin requirement
4242
4343 // Set download path to application directory to avoid temp folder permission issues
44- var appDirectory = Path . GetDirectoryName ( System . Reflection . Assembly . GetExecutingAssembly ( ) . Location ) ;
44+ var appDirectory = AppContext . BaseDirectory ;
4545 AutoUpdater . DownloadPath = appDirectory ;
4646 AutoUpdater . InstallationPath = appDirectory ;
4747
Original file line number Diff line number Diff line change 1010 <ItemGroup >
1111 <None Include =" ..\EDSDK\EDSDK.dll" Link =" EDSDK.dll" >
1212 <CopyToOutputDirectory >PreserveNewest</CopyToOutputDirectory >
13+ <CopyToPublishDirectory >PreserveNewest</CopyToPublishDirectory >
14+ <ExcludeFromSingleFile >true</ExcludeFromSingleFile >
1315 </None >
1416 <None Include =" ..\EDSDK\EdsImage.dll" Link =" EdsImage.dll" >
1517 <CopyToOutputDirectory >PreserveNewest</CopyToOutputDirectory >
18+ <CopyToPublishDirectory >PreserveNewest</CopyToPublishDirectory >
19+ <ExcludeFromSingleFile >true</ExcludeFromSingleFile >
1620 </None >
1721 </ItemGroup >
1822
Original file line number Diff line number Diff line change @@ -13,9 +13,9 @@ rem Build Canon.API in Release configuration
1313echo Building Canon.API...
1414dotnet build Canon.API --configuration Release --no-restore
1515
16- rem Publish Canon.API for deployment
17- echo Publishing Canon.API...
18- dotnet publish Canon.API --configuration Release --output ./publish --no-build --verbosity minimal
16+ rem Publish Canon.API for deployment as standalone executable
17+ echo Publishing Canon.API as standalone executable ...
18+ dotnet publish Canon.API/Canon.API.csproj --configuration Release --runtime win-x64 --self-contained true -p:PublishSingleFile=true --output ./publish --verbosity minimal
1919
2020echo .
2121echo Build completed successfully!
You can’t perform that action at this time.
0 commit comments