Skip to content

[NewTopic] C# and VB compiler flag "/deterministic" needs documentation #3828

@jcouv

Description

@jcouv

The C# and VB compilers offer a command-line option /deterministic but that option doesn't have documentation.

Tagging @BillWagner

Tell us where this topic should go in the Table of Contents.

For C#, it should be listed in

Similarly, for VB, it should be listed in

There should also be an entry for Deterministic flag in MSBuild at https://docs.microsoft.com/en-us/visualstudio/msbuild/csc-task and https://docs.microsoft.com/en-us/visualstudio/msbuild/vbc-task

Write an abstract

When the /deterministic flag is passed, the compiler(s) will produce a deterministic assembly (including module version GUID and timestamp). That means that the same byte-for-byte output will be produced given the same inputs.

Fill in an outline

  • One-line summary (see abstract above)
  • Syntax (that's just /deterministic)
  • Remarks

Here's the documentation that the compiler repo has so far:
https://github.com/dotnet/roslyn/blob/master/docs/compilers/Deterministic%20Inputs.md

Some points for remarks:

  • The module version GUID (MVID) is set deterministically, based on bits emitted, instead of a new GUID
  • The version of the assembly will be set deterministically, so wildcards in AssemblyVersionAttribute are disallowed
  • The timestamp of the assembly is also set deterministically, instead of recording the time when the bits where emitted

@gafter can help fill-in the blanks.

Suggest reviewers

@gafter @jcouv

Relates to https://github.com/MicrosoftDocs/visualstudio-docs/issues/361 and dotnet/roslyn#372

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions