locked
How to update (netstandard to NET5) and organize a class library RRS feed

  • Question

  • User379720387 posted

    I have a netstandard X.X Class Library that I need to upgrade to NET5.

    So far I have changed the TargetFramework to say Net5.0.

    Is there anything else I need to do to make that project upgrade to NET5.0

    Then,  the lack of organization of what is inside this project appears to be quite messy. In addition to Dependencies and Resources I have:  a Models folder and in the root I have classes for UI elements  and their matching Interfaces.

    Tried to create a folder Interfaces but when I create an Interface it doesn't give me the option to change where the Interface needs to be created. How can I get these interfaces out of the way?

    Saturday, November 28, 2020 1:21 PM

All replies

  • User475983607 posted

    I have a netstandard X.X Class Library that I need to upgrade to NET5.

    So far I have changed the TargetFramework to say Net5.0.

    Is there anything else I need to do to make that project upgrade to NET5.0

    It depends on what libraries you are using.  Read the migration docs to be sure to be sure you are not using any deprecated classes or methods.

    https://docs.microsoft.com/en-us/aspnet/core/migration/31-to-50?view=aspnetcore-5.0&tabs=visual-studio

    Tried to create a folder Interfaces but when I create an Interface it doesn't give me the option to change where the Interface needs to be created. How can I get these interfaces out of the way?

    I'm not sure what problem you are having.  

    I place the interface and the implementation in the same file.  I feel it's easier then switching between tabs.    But, an interface can exist is any folder, file, even another project.  The key is paying attention to the interface's namespace.  

    using myproject.myinterfaces

    Saturday, November 28, 2020 2:10 PM
  • User379720387 posted

    The Class Library that came with this solution was like this:

    <TargetFramework>netstandardX.X</TargetFramework>

    The link you gave me is to upgrade from core 3.1  to 5.0 and details the steps necessary for Server SideBlazor and WASM.  That is not what this Class Library is.

    Saturday, November 28, 2020 2:23 PM
  • User475983607 posted

    wavemaster

    The link you gave me is to upgrade from core 3.1  to 5.0 and details the steps necessary for Server SideBlazor and WASM.  That is not what this Class Library is.

    Keep in mind, you did not tell us what netstandard version you are currently targeting.  I'm not sure why that's a secrete.  Anyway, you actually have to take the time to read through the migration docs and pick one that fits your needs.  

    You might get away with simply changing the target if the class library is not very complex.  

    The netstandard docs are below if that's what you need. 

    https://docs.microsoft.com/en-us/dotnet/standard/net-standard

     

    Saturday, November 28, 2020 2:30 PM