[wix-devs] WixToolset.Dnc.HostGenerator errors
Sean Hall
r.sean.hall at gmail.com
Thu Jul 14 16:09:41 PDT 2022
Any luck? I've never seen this. I currently have .NET SDK 6.0.301 and
VS2022 17.2.5.
After some searching, the only thing I found was at
https://andrewlock.net/creating-a-source-generator-part-6-saving-source-generator-output-in-source-control/.
Where the project needed two properties together, though it would only
occur after the first time it's built:
<PropertyGroup>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath>
</PropertyGroup>
The source generator itself is super simple. It shouldn't be possible to
output the generated code twice like it appears to be doing from your
errors. I probably need to add a diagnostic when there's multiple
attributes defined, but currently it would only use the first one it finds.
The only other way I can imagine what happened here is if there were some
kind of bug causing Roslyn to run our generator twice.
On Thu, Jul 14, 2022 at 10:53 AM Sean Hall <r.sean.hall at gmail.com> wrote:
> You can get the files to be written to disk by adding this to the project
> consuming the generator (D:\src\wix4\src\test\burn\WixToolset.WixBA):
>
> <PropertyGroup>
> <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
> </PropertyGroup>
>
> It seems like the generator is running twice for some reason.
>
> On Thu, Jul 14, 2022 at 10:48 AM Rob Mensching via wix-devs <
> wix-devs at lists.wixtoolset.org> wrote:
>
>> I just started getting these sorts of errors in my local build (not
>> showing up in CI):
>>
>> D:\src\wix4\src\test\burn\WixToolset.WixBA\WixToolset.Dnc.HostGenerator\WixToolset.Dnc.HostGenerator.DncHostGenerator\WixToolset.Dnc.Host.g.cs(31,25):
>> error CS0101: The namespace 'WixToolset.Dnc.Host' already contains a
>> definition for 'BootstrapperApplicationFactory'
>> [D:\src\wix4\src\test\burn\WixToolset.WixBA\WixToolset.WixBA_jxw0bnr2_wpftmp.csproj]
>> D:\src\wix4\src\test\burn\WixToolset.WixBA\WixToolset.Dnc.HostGenerator\WixToolset.Dnc.HostGenerator.DncHostGenerator\WixToolset.Dnc.Host.g.cs(24,46):
>> error CS0101: The namespace 'WixToolset.Dnc.Host' already contains a
>> definition for 'StaticEntryDelegate'
>> [D:\src\wix4\src\test\burn\WixToolset.WixBA\WixToolset.WixBA_jxw0bnr2_wpftmp.csproj]
>> D:\src\wix4\src\test\burn\WixToolset.WixBA\WixToolset.Dnc.HostGenerator\WixToolset.Dnc.HostGenerator.DncHostGenerator\WixToolset.Dnc.Host.g.cs(29,6):
>> error CS0579: Duplicate 'GeneratedCode' attribute
>> [D:\src\wix4\src\test\burn\WixToolset.WixBA\WixToolset.WixBA_jxw0bnr2_wpftmp.csproj]
>> D:\src\wix4\src\test\burn\WixToolset.WixBA\WixToolset.Dnc.HostGenerator\WixToolset.Dnc.HostGenerator.DncHostGenerator\WixToolset.Dnc.Host.g.cs(30,6):
>> error CS0579: Duplicate 'CompilerGenerated' attribute
>> [D:\src\wix4\src\test\burn\WixToolset.WixBA\WixToolset.WixBA_jxw0bnr2_wpftmp.csproj]
>> D:\src\wix4\src\test\burn\WixToolset.WixBA\WixToolset.Dnc.HostGenerator\WixToolset.Dnc.HostGenerator.DncHostGenerator\WixToolset.Dnc.Host.g.cs(38,21):
>> error CS0111: Type 'BootstrapperApplicationFactory' already defines a
>> member called 'Create' with the same parameter types
>> [D:\src\wix4\src\test\burn\WixToolset.WixBA\WixToolset.WixBA_jxw0bnr2_wpftmp.csproj]
>> D:\src\wix4\src\test\burn\WixToolset.WixBA\WixToolset.Dnc.HostGenerator\WixToolset.Dnc.HostGenerator.DncHostGenerator\WixToolset.Dnc.Host.g.cs(45,55):
>> error CS0111: Type 'BootstrapperApplicationFactory' already defines a
>> member called 'CreateBAFactory' with the same parameter types
>> [D:\src\wix4\src\test\burn\WixToolset.WixBA\WixToolset.WixBA_jxw0bnr2_wpftmp.csproj]
>> D:\src\wix4\src\test\burn\WixToolset.WixBA\WixToolset.Dnc.HostGenerator\WixToolset.Dnc.HostGenerator.DncHostGenerator\WixToolset.Dnc.Host.g.cs(59,28):
>> error CS0111: Type 'BootstrapperApplicationFactory' already defines a
>> member called 'ModuleInitialize' with the same parameter types
>> [D:\src\wix4\src\test\burn\WixToolset.WixBA\WixToolset.WixBA_jxw0bnr2_wpftmp.csproj]
>>
>> What should I start looking at to diagnose what is going wrong? The .g.cs
>> files mentioned in the error messages do not exist.
>>
>>
>> Regards,
>>
>> Rob Mensching
>> CEO
>> FireGiant
>> _______________________________________________________________
>> FireGiant | Dedicated support for the WiX toolset |
>> http://www.firegiant.com/
>>
>> ____________________________________________________________________
>> WiX Toolset Developer Mailing List provided by FireGiant
>> http://www.firegiant.com/
>>
>
More information about the wix-devs
mailing list