Skip to content

Commit 0363dc8

Browse files
update
1 parent db6bed4 commit 0363dc8

File tree

1 file changed

+35
-42
lines changed

1 file changed

+35
-42
lines changed

README.md

Lines changed: 35 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -48,57 +48,29 @@ PM> Install-Package ElectronNET.API
4848
You start Electron.NET up with an `UseElectron` WebHostBuilder-Extension.
4949

5050
```csharp
51-
public static IWebHost BuildWebHost(string[] args)
52-
{
53-
return WebHost.CreateDefaultBuilder(args)
54-
.UseStartup<Startup>()
55-
.UseElectron(args)
56-
.Build();
57-
}
51+
public static IHostBuilder CreateHostBuilder(string[] args) =>
52+
Host.CreateDefaultBuilder(args)
53+
.ConfigureWebHostDefaults(webBuilder =>
54+
{
55+
webBuilder.UseElectron(args);
56+
webBuilder.UseStartup<Startup>();
57+
});
5858
```
5959

6060
## Startup.cs
6161

6262
Open the Electron Window in the Startup.cs file:
6363

6464
```csharp
65-
public void ConfigureServices(IServiceCollection services)
66-
{
67-
services.AddMvc(option => option.EnableEndpointRouting = false);
68-
}
69-
70-
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
65+
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
7166
{
72-
if (env.IsDevelopment())
73-
{
74-
app.UseDeveloperExceptionPage();
75-
app.UseBrowserLink();
76-
}
77-
else
78-
{
79-
app.UseExceptionHandler("/Home/Error");
80-
}
81-
82-
app.UseStaticFiles();
83-
84-
app.UseMvc(routes =>
85-
{
86-
routes.MapRoute(
87-
name: "default",
88-
template: "{controller=Home}/{action=Index}/{id?}");
89-
});
67+
...
9068

9169
// Open the Electron-Window here
9270
Task.Run(async () => await Electron.WindowManager.CreateWindowAsync());
9371
}
9472
```
9573

96-
__Please note:__ Currently it is important to use ASP.NET Core with MVC. If you are working with the dotnet CLI, use
97-
98-
```
99-
dotnet new mvc
100-
```
101-
10274
## Start the Application
10375

10476
To start the application make sure you have installed the "[ElectronNET.CLI](https://www.nuget.org/packages/ElectronNET.CLI/)" packages as global tool:
@@ -119,13 +91,26 @@ electronize init
11991
```
12092
electronize start
12193
```
94+
95+
### Note
96+
> Only the first electronize start is slow. The next will go on faster.
97+
98+
## Develop Electron.NET apps using a file watcher
99+
100+
The file watcher is included with version 8.31.1 of Electron.NET. For example, a file change can trigger compilation, test execution, or deployment. The Electron.NET window will automatically refresh and new code changes will be visible more quickly. The following Electron.NET CLI command is required:
101+
102+
```
103+
electronize start /watch
104+
```
105+
122106
### Note
123107
> Only the first electronize start is slow. The next will go on faster.
124108
125109
## Debug
126110

127111
Start your Electron.NET application with the Electron.NET CLI command. In Visual Studio attach to your running application instance. Go in the __Debug__ Menu and click on __Attach to Process...__. Sort by your projectname on the right and select it on the list.
128112

113+
129114
## Usage of the Electron-API
130115

131116
A complete documentation will follow. Until then take a look in the source code of the sample application:
@@ -181,7 +166,7 @@ Please make sure all commits are properly documented.
181166

182167
See also the list of [contributors](https://github.com/ElectronNET/Electron.NET/graphs/contributors) who participated in this project.
183168

184-
## Donate
169+
# Donate
185170

186171
We do this open source work in our free time. If you'd like us to invest more time on it, please [donate](https://donorbox.org/electron-net). Donation can be used to increase some issue priority. Thank you!
187172

@@ -192,21 +177,29 @@ MIT-licensed
192177

193178
# Important notes
194179

195-
## ElectronNET.API & ElectronNET.CLI Version 5.22.12
180+
## ElectronNET.API & ElectronNET.CLI Version 8.31.1
181+
182+
Make sure you also have the new Electron.NET API & CLI 8.31.1 version.
183+
184+
```
185+
dotnet tool update ElectronNET.CLI -g
186+
```
196187

197-
Make sure you also have the new Electron.NET CLI 5.22.12 version. This now uses [electron-builder](https://www.electron.build/configuration/configuration) and the necessary configuration to build is made in the **electron.manifest.json** file. In addition, own Electron.NET configurations are stored. Please make sure that your **electron.manifest.json** file has the following new structure:
188+
This now uses [electron-builder](https://www.electron.build/configuration/configuration) and the necessary configuration to build is made in the **electron.manifest.json** file (on the build part). In addition, own Electron.NET configurations are stored (on the root). Please make sure that your **electron.manifest.json** file has the following new structure:
198189

199190
```
200191
{
201192
"executable": "{{executable}}",
202193
"splashscreen": {
203194
"imageFile": ""
204195
},
196+
"name": "{{executable}}",
197+
"author": "",
205198
"singleInstance": false,
206199
"build": {
207200
"appId": "com.{{executable}}.app",
208201
"productName": "{{executable}}",
209-
"copyright": "Copyright © 2019",
202+
"copyright": "Copyright © 2020",
210203
"buildVersion": "1.0.0",
211204
"compression": "maximum",
212205
"directories": {
@@ -251,7 +244,7 @@ dotnet restore
251244
If you still use this version you will need to invoke it like this:
252245

253246
```
254-
dotnet electronize ...
247+
electronize ...
255248
```
256249

257250
## Node Integration

0 commit comments

Comments
 (0)