C#: How to use Service References in Visual Studio 2015 (Move from Linqpad)
<p>I would like to migrate a C# Program to Visual Studio. I'm fairly new working with C#, however I could have learned some stuff in Linqpad.
In Linqpad I imported my dll as an additional Reference and could use it. The dll was generated with:</p>

<pre><code>"wsdl http://localhost/WebService.asmx"
</code></pre>

<p>and</p>

<pre><code>"csc /t:library WebService.cs"
</code></pre>

<p>Linqpad Code which worked was like:</p>

<pre><code>WebService ws = new WebService();
void Main()
{
    try
    {
        var connect = ws.Logon("localhost", Port, "", "username", "password);
        var morefiles = false;
    // do other stuff....

    do
    {
        var results = ws.search(connect, "Culture", "Culture", searchCondition, morefiles);
    } while (morefiles == true);
    }
    catch (Exception x)
    {
    Console.WriteLine(x.Message);
    Console.WriteLine(x.StackTrace);
    }
    finally {
    Console.WriteLine("Search done");
    }
}
</code></pre>

<p>Now, I would like to use it in Visual Studio. In VS I imported it as a Service References with the given URL, and it showed me the necessary stuff.
Now when I try to use it in my code I get an error message which tells me:</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Testproject.WebService;

namespace Testproject
{

    class Program
    {

        static void Main(string[] args)
        {
            WebService ws = new WebService();
            Console.WriteLine("Test");
            Console.ReadKey();
        }
    }
}
</code></pre>

<p>The error message is in the line:</p>

<pre><code>WebService ws = new WebService();
</code></pre>

<p>It shows me this error message:</p>

<blockquote>
  <p>WebService is a 'namespace' but is used like a 'type'</p>
</blockquote>

<p>I also found out, that "Logon" which I used in Line 6 in Linqpad is in:</p>

<blockquote>
  <p>WebService.WebServiceSoap</p>
</blockquote>

<p>However, if I change the line in:</p>

<pre><code>WebService.WebServiceSoap ws = new WebService.WebServiceSoap();
</code></pre>

<p>I also get an error message:</p>

<blockquote>
  <p>Cannot create an instance of the abstract class or interface</p>
</blockquote>

<p>I tried different combinations also, but I don't exactly no, what can be wrong. Can you help me?</p>