For self-contained use, the publishing is configured for single-file deployment, via PublishSingleFile=true. Invoking the generator from said executable fails with a familiar Object reference not set to an instance of object error if you pass --managementapi true --apikey <apikey>.
The error is not present when used as a .NET cli tool or if the self-contained app is not published into single file. Possibly introduced by changes in .NET 6.0 as it sounds similar to https://github.com/CarterCommunity/Carter/issues/291, though I'm not familiar with carter or if it's used in any of the generator's dependencies.
Repro steps
Download the self-contained app from the repo or generate one using the PS script.
Run the generator from the executable with --projectid <projid> --managementapi true --apikey <apikey> params
Brief bug description
For self-contained use, the publishing is configured for single-file deployment, via
PublishSingleFile=true
. Invoking the generator from said executable fails with a familiarObject reference not set to an instance of object
error if you pass--managementapi true --apikey <apikey>
.The error is not present when used as a .NET cli tool or if the self-contained app is not published into single file. Possibly introduced by changes in .NET 6.0 as it sounds similar to https://github.com/CarterCommunity/Carter/issues/291, though I'm not familiar with carter or if it's used in any of the generator's dependencies.
Repro steps
--projectid <projid> --managementapi true --apikey <apikey> params
Expected behavior
MAPI models are generated.
Test environment