Skip to content

Commit 0d26c6e

Browse files
authored
Merge pull request #2010 from vzakanj/main
2 parents 4f1e737 + 15e93dd commit 0d26c6e

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

docs/guide/codegen.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,20 @@ you're quickly starting and stopping your application. The `Auto` mode will writ
6767
source code for missing types to the `Internal/Generated` folder under your main application
6868
project.
6969

70+
::: tip
71+
If you're using the `Auto` mode in combination with `dotnet watch` you need to disable the watching of
72+
the `Internal/Generated` folder to avoid application restarts each time codegen writes a new file.
73+
You can do this by adding the following to the `.csproj` file of your app project.
74+
75+
```xml
76+
<ItemGroup>
77+
<Compile Update="Internal\Generated\**\*.cs" Watch="false" />
78+
</ItemGroup>
79+
```
80+
81+
:::
82+
83+
7084
At production time, if there is any issue whatsoever with resource utilization, the Wolverine team
7185
recommends using the `Static` mode where all types are assumed to be pre-generated into what Wolverine
7286
thinks is the application assembly (more on this in the troubleshooting guide below).
@@ -356,7 +370,7 @@ and you can configure different behavior for production versus development time
356370
using var host = await Host.CreateDefaultBuilder()
357371
.UseWolverine(opts =>
358372
{
359-
// Use "Auto" type load mode at development time, but
373+
// Use "Dynamic" type load mode at development time, but
360374
// "Static" any other time
361375
opts.Services.CritterStackDefaults(x =>
362376
{
@@ -377,5 +391,5 @@ using var host = await Host.CreateDefaultBuilder()
377391

378392
Which will use:
379393

380-
1. `TypeLoadMode.Auto` when the .NET environment is "Development" and try to write new source code to file
394+
1. `TypeLoadMode.Dynamic` when the .NET environment is "Development" and dynamically generate types on the first usage
381395
2. `TypeLoadMode.Static` for other .NET environments for optimized cold start times

0 commit comments

Comments
 (0)