-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal Compilation Error: preprocessor directives, not placed on new line #725
Comments
Temporary workaround: Fixate the SDK to a working version and disable rollforward in a global.json. This works for me:
|
thanks for the suggestion. I tried that, and then forced a regeneration (after a VS restart) and the result still contained malformed C#. |
I was able to temporarily suppress the generation of the [ValueObject<uint>
#if VOGEN_IS_BROKEN
( parsableForStrings: ParsableForStrings.GenerateNothing,
tryFromGeneration: TryFromGeneration.Omit,
parsableForPrimitives: ParsableForPrimitives.GenerateNothing )
#endif
] |
I'm running into the same issue. I put the SDK version back to I tried @aabs suggestion, but that [ValueObject<string>(
tryFromGeneration: TryFromGeneration.Omit,
parsableForPrimitives: ParsableForPrimitives.GenerateNothing
)]
public readonly partial struct PirepId; It's generating: /// <summary>
/// </summary>
/// <returns>
/// True if the value passes any validation (after running any optional normalization).
/// </returns>
public static global::System.Boolean TryParse(
#if NETCOREAPP3_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
global::System.String? s, global::System.IFormatProvider? provider,
#if NETCOREAPP3_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.MaybeNullWhen(false)]
#endif
out PirepId result) |
Damn, looks like only back to |
Adding |
…eMaybeNullWhenFalse. Fixes SteveDunn#725.
Describe the bug
Getting errors after updating to Microsoft Visual Studio Professional 2022 (64-bit) - Preview
Version 17.13.0 Preview 2.0.
The error messages produced indicate malformed code generation in Vogen:
The original code looks like this:
The generated code contains this:
Note the fragment
TryFrom( #if NETCOREAPP
which is invalid.Steps to reproduce
Update VS to latest preview (17.13.0 Preview 2.0).
Rebuild the code. Build will fail with the above issue.
I tried updating to the latest version of the Nuget pkg (5.0.6) and restarting VS, but the code generated still broke.
Expected behaviour
The
#if
should be on a new line. Then all should be fine.The text was updated successfully, but these errors were encountered: