title: How to fix an error CS1061 in a C# console application?
body: <p>I am currently learning C# and .NET and I am currently learning how to make a NuGet package. One of the files that I have is set up as such:</p>
  
  <pre><code>using System.Text.RegularExpressions;
  
   namespace Packt.CS7
   {
  public static class StringExtensions
  {
      public static bool IsValidXmlTag(this string input)
      {
          return Regex.IsMatch(input, @"^&lt;([a-z]+)([^&lt;]+)*(?:&gt;(.*)&lt;\/\1&gt;|\s+\/&gt;)$");
      }
  
      public static bool IsValidPassword(this string input)
      {
          return Regex.IsMatch(input, "^[a-zA-Z0-9_-]{8,}$");
      }
  
      public static bool IsValidHex(this string input)
      {
          return Regex.IsMatch(input, "^#?([a-fA-F0-9]{3}|[a-fA-F0-9]{6})$");
      }
  }
  }
  </code></pre>
  
  <p>And my Program.cs is set up like this:</p>
  
  <pre><code>using System;
  using System.Xml.Linq;
  using static System.Console;
  using Packt.CS7;
  
  namespace Assemblies
  {
  class Program
  {
      static void Main(string[] args)
      {
          Write("Enter a valid color valid in hex: ");
          string hex = ReadLine();
          WriteLine($"Is {hex} a valid color value: {hex.IsValidHex()}");
  
          Write("Enter a valid XML tag: ");
          string xmlTag = ReadLine();
          WriteLine($"Is {xmlTag} a valid XML tag: {xmlTag.IsValidXmlTag()}");
  
          Write("Enter a valid password: ");
          string password = ReadLine();
          WriteLine($"Is {password} a valid password: {password.IsValidPassword()}");
      }
  }
  }
  </code></pre>
  
  <p>When the console application is run it is supposed to output:</p>
  
  <pre><code>Enter a valid color value in hex: 00ffc8
  Is 00ffc8 a valid color value: True
  Enter a valid XML tag: &lt;h1 class="&lt;" /&gt;
  Is &lt;h1 class="&lt;" /&gt; a valid XML tag: False
  Enter a valid password: secretsauce
  Is secretsauce a valid password: True
  </code></pre>
  
  <p>However what I am getting in the console is this:</p>
  
  <pre><code>Program.cs(14,60): error CS1061: 'string' does not contain a definition for 'IsValidHex' and no 
  accessible extension method 'IsValidHex' accepting a first argument of type 'string' could be found 
  (are you missing a using directive or an assembly reference?) 
  [/Users/steelwind/HardWay/c#and.NET/Chapter07/Assemblies/Assemblies.csproj]
  
  The build failed. Fix the build errors and run again.
  </code></pre>
  
  <p>I believe the problem lies in the fact when I open the first file, when it is open in VSCode it says that each of the classes has "0 references" meaning that it isn't being called somehow in the Program.cs. However I am not sure why.</p>
  
  <p>Here is my files structure:</p>
  
  <pre><code> Assemblies:
   &gt;Assemblies.csproj
    ^bin
     ^Debug
      ^netcoreapp3.0
     ^Release
      ^netcoreapp3.0
       &gt;Assemblies
      &gt;Assemblies.deps.json
      &gt;Assemblies.dll
      &gt;Assemblies.pbd
      &gt;Assemblies.runtimeconfig.dev.json
      &gt;Assemblies.runtimeconfig.json
      &gt;Newtonsoft.Json.dll
   ^obj
   &gt;Program.cs
  
  Shared library:
   ^bin
    ^Bin
     ^Debug
       ^netstandard2.0
        &gt;SharedLibrary.deps.json
        &gt;SharedLibrary.dll
        &gt;SharedLibrary.pbd
       ^netstandard3.0
      wtsegarsMyFirstPackage1.0.0.nupkg
     ^Release
      ^netstandard
       &gt;SharedLibrary.dll
       &gt;SharedLibrary.pbd
   ^obj
   SharedLibrary.csproj
     StringExtensions.cs
  </code></pre>