0

Before I ask my question I must say that I read MSDN website before and used Using System; as namespace for class.

When I use the class UriBuilder with Using System in my code,it is dis-active. What is the namespace of this class?

I am using visual studio 2008 and my operation system is windows 7.

The sample of code

public partial class Form1 : Form
{
    static public string AssemblyDirectory
    {
        get
        {
            string codeBase = Assembly.GetExecutingAssembly().CodeBase;
            UriBuilder uri = new UriBuilder(codeBase);
            string path = (uri.Path);
            return Path.GetDirectoryName(path);
        }
    }
Junaith
  • 3,298
  • 24
  • 34
user3403967
  • 53
  • 1
  • 6
  • What happens if you replace `UriBuilder` with `global::System.UriBuilder`? – Luaan Mar 12 '14 at 10:39
  • Well, you need to have a reference to `System.dll`, but I don't see how you could *not* have a reference to that seeing that it's a windows forms application etc. What does "dis-active" mean? Does it not compile? What error does it print out? – Luaan Mar 12 '14 at 11:56

1 Answers1

0

This MSDN link shows you which namespace to use and the assembly you will need to reference to utilize this class for each version of the .NET framework.

http://msdn.microsoft.com/en-us/library/system.web.ui.design.urlbuilder(v=vs.110).aspx

DaveRead
  • 3,371
  • 1
  • 21
  • 24