title: Classic ASP using C# .net DLL Object doesn't support this property or method
body: <p>Hey all this is my first time creating a COM object for a classic asp page.</p>
  
  <p>The process I followed when creating this COM DLL is this:</p>
  
  <p>1) Used the Strong Name Tool (sn.exe) and placed the .snk file within the app. (sn -k myKey.snk)</p>
  
  <p>2) Added:</p>
  
  <pre><code>[assembly: AssemblyKeyFile(@"myKey.snk")]
  [assembly: ComVisible(true)]
  </code></pre>
  
  <p>to the AssemblyInfo.cs. I do get a <strong>warning</strong> on the KeyFile saying:</p>
  
  <blockquote>
    <p>Use command line option '/keyfile' or appropriate project settings
    instead of 'AssemblyKeyFile'</p>
  </blockquote>
  
  <p>3) Ran the following from the Administrator: SDK Command Prompt:</p>
  
  <pre><code>tlbexp c:\\temp\\dll\\classicASPWSEnDecrypt.dll /out:c:\\temp\\dll\\classicASPWSEnDecrypt.tlb
  
  regasm /tlb:c:\\temp\\dll\\classicASPWSEnDecrypt.tlb c:\\temp\\dll\\classicASPWSEnDecrypt.dll
  
  gacutil /i c:\\temp\\dll\\classicASPWSEnDecrypt.dll
  
  regasm c:\\temp\\dll\\classicASPWSEnDecrypt.dll /codebase
  </code></pre>
  
  <p>All registered just fine without errors.</p>
  
  <p>In my classic ASP page i have:</p>
  
  <pre><code>&lt;%
   Dim classicEnDecrypt
   Set classicEnDecrypt = Server.CreateObject("classicASPWSEnDecrypt.Class1")
  
   response.write(classicEnDecrypt.Encrypt("testing"))
  %&gt;
  </code></pre>
  
  <p>I found that the <strong>ProgID</strong> (using OLEView) was Class1 as seen below:
  <img src="https://i.stack.imgur.com/n3bgT.png" alt="enter image description here"></p>
  
  <p>And my C# code (just a snip) is this:</p>
  
  <pre><code>namespace classicASPWSEnDecrypt
  {
    public class Class1
    {
        public string Encrypt(string PlainText)
        {
           [code here]
        }
  
        public string Decrypt(string EncryptedText)
        {
           [code here]
        }
    }
  }
  </code></pre>
  
  <p>Once I run the ASP page on my local machine (IIS7/Windows 7 Enterprise) I get this error:</p>
  
  <blockquote>
    <p>Microsoft VBScript runtime error '800a01b6' </p>
    
    <p>Object doesn't support this property or method: 'Encrypt' </p>
    
    <p>/contactupdateWS.asp, line 49</p>
  </blockquote>
  
  <p>Not quite sure why it says I don't have Encrypt function when I know I do?!</p>
  
  <p>What could I be missing?</p>