Skip to content

Commit 02274fa

Browse files
committed
Fix publishing documentation
1 parent a4f1e0a commit 02274fa

File tree

2 files changed

+29
-23
lines changed

2 files changed

+29
-23
lines changed

docs/Core/Migration-Checks.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ When you build an Electron.NET project, the following validation checks are perf
1313
| [ELECTRON003](#3-electron-builderjson-location) | electron-builder.json location | Verifies electron-builder.json exists in Properties folder |
1414
| [ELECTRON004](#3-electron-builderjson-location) | electron-builder.json wrong location | Warns if electron-builder.json is found in incorrect locations |
1515
| [ELECTRON005](#4-parent-paths-not-allowed-in-electron-builderjson) | Parent paths not allowed | Checks for `..` references in config |
16-
| [ELECTRON006](#5-publish-profile-validation) | Publish profile validation | Validates pubxml configuration |
16+
| [ELECTRON006](#5-publish-profile-validation) | ASP.NET publish profile mismatch | Warns when ASP.NET projects have console-style profiles |
17+
| [ELECTRON007](#5-publish-profile-validation) | Console publish profile mismatch | Warns when console projects have ASP.NET-style profiles |
1718

1819
---
1920

@@ -178,15 +179,26 @@ During the publish process, the `electron-builder.json` file is copied to the bu
178179

179180
## 5. Publish Profile Validation
180181

181-
**Warning Code:** `ELECTRON006`
182+
**Warning Codes:** `ELECTRON006`, `ELECTRON007`
182183

183184
### What is checked
184185

185-
The build system examines `.pubxml` files in the `Properties/PublishProfiles` folder and checks for `WebPublishMethod` and `ProjectGuid` properties, which indicate ASP.NET-style publish profiles.
186+
The build system examines `.pubxml` files in the `Properties/PublishProfiles` folder and validates that they match the project type:
187+
188+
- **ELECTRON006**: For **ASP.NET projects** (using `Microsoft.NET.Sdk.Web`), checks that publish profiles include `WebPublishMethod`. This property is required for proper ASP.NET publishing.
189+
190+
- **ELECTRON007**: For **console/other projects** (not using the Web SDK), checks that publish profiles do NOT include the `WebPublishMethod` property. These ASP.NET-specific properties are incorrect for non-web applications.
186191

187192
### Why this matters
188193

189-
Electron.NET uses a special publish process that packages your application with Electron. Standard ASP.NET publish profiles may not work correctly and can lead to incomplete or broken builds.
194+
Electron.NET supports both ASP.NET and console application project types, each requiring different publish profile configurations:
195+
196+
| Project Type | SDK | Expected Properties |
197+
|--------------|-----|---------------------|
198+
| ASP.NET (Razor Pages, MVC, Blazor) | `Microsoft.NET.Sdk.Web` | `WebPublishMethod`, no `PublishProtocol` |
199+
| Console Application | `Microsoft.NET.Sdk` | `PublishProtocol`, no `WebPublishMethod` |
200+
201+
Using the wrong publish profile type can lead to incomplete or broken builds.
190202

191203
### How to fix
192204

@@ -196,19 +208,7 @@ Electron.NET uses a special publish process that packages your application with
196208
- Select **Publish...**
197209
- Follow the wizard to create a **Folder** publish profile
198210

199-
**Correct publish profile example:**
200-
```xml
201-
<?xml version="1.0" encoding="utf-8"?>
202-
<Project>
203-
<PropertyGroup>
204-
<PublishUrl>publish\</PublishUrl>
205-
<PublishDir>publish\</PublishDir>
206-
<SelfContained>true</SelfContained>
207-
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
208-
<PublishSingleFile>false</PublishSingleFile>
209-
</PropertyGroup>
210-
</Project>
211-
```
211+
For correct publish profile examples for both ASP.NET and Console applications, see **[Package Building](../Using/Package-Building.md#step-1-create-publish-profiles)**.
212212

213213
---
214214

docs/Using/Package-Building.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,15 @@ Add publish profiles to `Properties/PublishProfiles/`:
2626
<PropertyGroup>
2727
<Configuration>Release</Configuration>
2828
<Platform>Any CPU</Platform>
29-
<PublishDir>publish\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\</PublishDir>
30-
<PublishProtocol>FileSystem</PublishProtocol>
29+
<DeleteExistingFiles>true</DeleteExistingFiles>
30+
<PublishProvider>FileSystem</PublishProvider>
31+
<PublishUrl>publish\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\</PublishUrl>
32+
<WebPublishMethod>FileSystem</WebPublishMethod>
33+
<_TargetId>Folder</_TargetId>
3134
<TargetFramework>net10.0</TargetFramework>
3235
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
36+
<ProjectGuid>48eff821-2f4d-60cc-aa44-be0f1d6e5f35</ProjectGuid>
3337
<SelfContained>true</SelfContained>
34-
<PublishSingleFile>false</PublishSingleFile>
3538
</PropertyGroup>
3639
</Project>
3740
```
@@ -46,12 +49,15 @@ Add publish profiles to `Properties/PublishProfiles/`:
4649
<PropertyGroup>
4750
<Configuration>Release</Configuration>
4851
<Platform>Any CPU</Platform>
49-
<PublishDir>publish\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\</PublishDir>
50-
<PublishProtocol>FileSystem</PublishProtocol>
52+
<DeleteExistingFiles>true</DeleteExistingFiles>
53+
<PublishProvider>FileSystem</PublishProvider>
54+
<PublishUrl>publish\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\</PublishUrl>
55+
<WebPublishMethod>FileSystem</WebPublishMethod>
56+
<_TargetId>Folder</_TargetId>
5157
<TargetFramework>net10.0</TargetFramework>
5258
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
59+
<ProjectGuid>48eff821-2f4d-60cc-aa44-be0f1d6e5f35</ProjectGuid>
5360
<SelfContained>true</SelfContained>
54-
<PublishSingleFile>false</PublishSingleFile>
5561
</PropertyGroup>
5662
</Project>
5763
```

0 commit comments

Comments
 (0)