Make Library Folder Visible

Visible

  1. Make Library Folder Permanently Visible
  2. Os X Make Library Folder Visible
-->

In this tutorial, you create a simple class library that contains a single string-handling method.

A class library defines types and methods that are called by an application. If the library targets .NET Standard 2.0, it can be called by any .NET implementation (including .NET Framework) that supports .NET Standard 2.0. If the library targets .NET 5, it can be called by any application that targets .NET 5. This tutorial shows how to target .NET 5.

When you create a class library, you can distribute it as a NuGet package or as a component bundled with the application that uses it.

Prerequisites

  • Visual Studio 2019 version 16.8 or a later version with the .NET Core cross-platform development workload installed. The .NET 5.0 SDK is automatically installed when you select this workload. This tutorial assumes you have enabled Show all .NET Core templates in the New project, as shown in Tutorial: Create a .NET console application using Visual Studio.

Create a solution

If a certain folder has unique permissions ā€“ it (along with its contents) will not be visible to anyone else. To check whether or not you have unique permissions at the folder level, click the checkbox next to a file or folder and then click on the ā€œiā€ Document Information Panel on the right-hand-side of a document library. This ensures that any new apps you download appear on your Home screen, rather than hiding away in the App Library. Make sure all your Home screens are visible. One of the reasons Apple introduced the App Library was because some users felt frustrated at how cluttered their Home screens had become. In your library look to the top left side click on organize, then on folder and search options, go to the view tab section and uncheck the top option, always show icons and never thumbnails, scroll down the list and check show hidden folders, files and drives, click on apply and okay or save. How to Make the Library Visible Permanently. Apple hides the Library folder by setting a file system flag associated with the folder. You can toggle the visibility flag for any folder on your Mac. Apple chose to set the Library folder's visibility flag to the off state by default. Here's how to change it.

Start by creating a blank solution to put the class library project in. A Visual Studio solution serves as a container for one or more projects. You'll add additional, related projects to the same solution.

To create the blank solution:

  1. Start Visual Studio.

  2. On the start window, choose Create a new project.

  3. On the Create a new project page, enter solution in the search box. Choose the Blank Solution template, and then choose Next.

  4. On the Configure your new project page, enter ClassLibraryProjects in the Project name box. Then choose Create.

Create a class library project

  1. Add a new .NET class library project named 'StringLibrary' to the solution.

    1. Right-click on the solution in Solution Explorer and select Add > New Project.

    2. On the Add a new project page, enter library in the search box. Choose C# or Visual Basic from the Language list, and then choose All platforms from the Platform list. Choose the Class Library template, and then choose Next.

    3. On the Configure your new project page, enter StringLibrary in the Project name box, and then choose Next.

    4. On the Additional information page, select .NET 5.0 (Current), and then choose Create.

  2. Check to make sure that the library targets the correct version of .NET. Right-click on the library project in Solution Explorer, and then select Properties. The Target Framework text box shows that the project targets .NET 5.0.

  3. If you're using Visual Basic, clear the text in the Root namespace text box.

    For each project, Visual Basic automatically creates a namespace that corresponds to the project name. In this tutorial, you define a top-level namespace by using the namespace keyword in the code file.

  4. Replace the code in the code window for Class1.cs or Class1.vb with the following code, and save the file. If the language you want to use is not shown, change the language selector at the top of the page.

    The class library, UtilityLibraries.StringLibrary, contains a method named StartsWithUpper. This method returns a Boolean value that indicates whether the current string instance begins with an uppercase character. The Unicode standard distinguishes uppercase characters from lowercase characters. The Char.IsUpper(Char) method returns true if a character is uppercase.

    StartsWithUpper is implemented as an extension method so that you can call it as if it were a member of the String class.

  5. On the menu bar, select Build > Build Solution or press Ctrl+Shift+B to verify that the project compiles without error.

Add a console app to the solution

Add a console application that uses the class library. The app will prompt the user to enter a string and report whether the string begins with an uppercase character.

  1. Add a new .NET console application named 'ShowCase' to the solution.

    1. Right-click on the solution in Solution Explorer and select Add > New project.

    2. On the Add a new project page, enter console in the search box. Choose C# or Visual Basic from the Language list, and then choose All platforms from the Platform list.

    3. Choose the Console Application template, and then choose Next.

    4. On the Configure your new project page, enter ShowCase in the Project name box. Then choose Next.

    5. On the Additional information page, select .NET 5.0 (Current) in the Target Framework box. Then choose Create.

  2. In the code window for the Program.cs or Program.vb file, replace all of the code with the following code.

    The code uses the row variable to maintain a count of the number of rows of data written to the console window. Whenever it's greater than or equal to 25, the code clears the console window and displays a message to the user.

    The program prompts the user to enter a string. It indicates whether the string starts with an uppercase character. If the user presses the Enter key without entering a string, the application ends, and the console window closes.

Add a project reference

Initially, the new console app project doesn't have access to the class library. To allow it to call methods in the class library, create a project reference to the class library project.

  1. In Solution Explorer, right-click the ShowCase project's Dependencies node, and select Add Project Reference.

  2. In the Reference Manager dialog, select the StringLibrary project, and select OK.

Mojave

Run the app

  1. In Solution Explorer, right-click the ShowCase project and select Set as StartUp Project in the context menu.

  2. Press Ctrl+F5 to compile and run the program without debugging.

  3. Try out the program by entering strings and pressing Enter, then press Enter to exit.

Additional resources

Make Library Folder Permanently Visible

  • .NET Standard versions and the platforms they support.

Next steps

In this tutorial, you created a class library. In the next tutorial, you learn how to unit test the class library.

Or you can skip automated unit testing and learn how to share the library by creating a NuGet package:

Os X Make Library Folder Visible

Or learn how to publish a console app. If you publish the console app from the solution you created in this tutorial, the class library goes with it as a .dll file.