Build Great Libraries using .NET Standard

Sign in to queue

The Discussion

  • User profile image
    Andrii
  • User profile image
    Andrii

    What about slides?

  • User profile image
    chichun

    1. Any alternative or best practice to using the preprocessor directives (eg. #if NET461, #if WINDOWS_UWP)? Looks like it can get smelly (open closed principle and web analogy would be "if IE version X")

    2. What is the recommended approach to unit testing a .NET Standard library? (eg. separate test project per target framework or preprocessor directives)

  • User profile image
    terrajobst

    What about slides?

    I believe we'll add them here. Until then, you can grab them from here.

    1. Any alternative or best practice to using the preprocessor directives (eg. #if NET461, #if WINDOWS_UWP)? Looks like it can get smelly (open closed principle and web analogy would be "if IE version X")

    As few as possible would be my advice. You can also configure your MSBuild project to selectively include files on a naming convention. That's what Xamarin Essentials are doing.

    2. What is the recommended approach to unit testing a .NET Standard library? (eg. separate test project per target framework or preprocessor directives)

    Right now, I'd recommend separate projects and a Shared Project to centralize the source code for the tests.

  • User profile image
    deef

    For me personally, this was the best dotnetconf talk. Great stuff.

  • User profile image
    wkempf

    On the strong naming, your advice makes sense but seems to be a departure from historical recommendation? Given that strong naming isn't a security thing and the recommendation you're giving is to check-in both the public and private keys, what's the recommendation about using a password on the private key? Is there a reason to? If not, wouldn't it make sense for the project templates to just set this up as the default?

  • User profile image
    shmuelie

    I've been personally using https://github.com/kzu/GitInfo to integrate git information

  • User profile image
    terrajobst

    What's the recommendation about using a password on the private key? Is there a reason to?

    I wouldn't bother. Just check it in as-is.

    If not, wouldn't it make sense for the project templates to just set this up as the default?

    We discussed this, but it seemed over the top for general libraries. It's the same as with NuGet packages. It makes sense for libraries you ship publicly, but not all libraries will be released to the general public, so it seems like overkill for the template.

  • User profile image
    Jelle

    Great video!, do you have any news on multi-target support for vs4mac?

  • User profile image
    mhutch

    do you have any news on multi-target support for vs4mac?

    Visual Studio for Mac can load multi-targeting projects, but build and intellisense currently use only the first target framework. As a workaround, if you use `msbuild` in the terminal to build the solution, it will build all the frameworks.

    To track progress you call follow the issues on this GitHub board: https://github.com/mono/monodevelop/projects/1

  • User profile image
    mshwf
    If .NET standard is a specification, does it has only one specification which is: it's platform agnostic? because it seems to me the only reasonable specification that it must implement!
  • User profile image
    indcoder

Add Your 2 Cents