Create Virtual Directory in IIS using VB.NET - Page 2-VBForums
Page 2 of 2 FirstFirst 12
Results 41 to 65 of 65

Thread: Create Virtual Directory in IIS using VB.NET

  1. #41

  2. #42
    New Member h.annous's Avatar
    Join Date
    Apr 2007
    Location
    Lebanon
    Posts
    5

    Re: Create Virtual Directory in IIS using VB.NET

    I'm a little new to VB.NET.
    The properties collection is of type PropertyCollection.
    What's the type of each of the elements (the one to use in the for each loop)?

  3. #43
    New Member
    Join Date
    Apr 2007
    Posts
    1

    Re: Create Virtual Directory in IIS using VB.NET

    I think this will give you what you need.


    link

    Thanks for the code. It was exactly what I was looking for.
    Last edited by RobM; Apr 27th, 2007 at 10:56 AM.

  4. #44
    New Member
    Join Date
    Jul 2007
    Posts
    7

    Re: Create Virtual Directory in IIS using VB.NET

    i dopied source code for creating virtual directory in IIS of local server . but if i want to Create in IIS of another PC using IP adderess ,what should i change in that code??? anyone plssss i m new user ...

  5. #45
    New Member h.annous's Avatar
    Join Date
    Apr 2007
    Location
    Lebanon
    Posts
    5

    Re: Create Virtual Directory in IIS using VB.NET

    Instead of LocalHost pass the IP address.

  6. #46
    New Member
    Join Date
    Jul 2007
    Posts
    7

    Re: Create Virtual Directory in IIS using VB.NET

    hi,i can create virtual directory in IIS .but i want to create a New website i.e.www.testing.com. how can i create using vb.net any idea plz plz tell me.....

    thanx in Advance

  7. #47

  8. #48
    New Member
    Join Date
    Jul 2007
    Posts
    7

    Re: Create Virtual Directory in IIS using VB.NET

    thanks woka.
    i want ur suggestion.
    what should i use in my project .
    MYSQL or microsoft's SQL server as backend in .NET????
    if i want to use MYSQL as backend which technology should i prefer?
    apache/PHP or .NET??

  9. #49

  10. #50

  11. #51
    New Member
    Join Date
    Jul 2007
    Posts
    7

    Re: Create Virtual Directory in IIS using VB.NET

    hi, woka
    i m creating job searching website.
    jobseekers can resume their CV,search for vaccancies..etc..etc..
    it is very big Project..

    if i use My SQL as a backend ,will it create any problem(i.e.like speed slow,efficiency etc.)??

    i don't want to use MS SQL Server as a backend.

  12. #52

  13. #53
    New Member
    Join Date
    Jul 2007
    Posts
    7

    Re: Create Virtual Directory in IIS using VB.NET

    hi, woka

    i m working on the project as per the client requirement. my client wants to use my sql as a backend. do u have any idea plssss??

  14. #54

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,633

    Re: Create Virtual Directory in IIS using VB.NET

    Ideas on what?
    If your client wants My SQL then use My SQL...I wudn't. I would use SQL Svr...MSDE 2000 or MSDE 2005 Express.
    My SQL won't cause you any issues I don't think, it's just not as good as SQL Server.

    You want to be asking these kind of questions in the DB section...you'll get a bigger response.

    Woka

  15. #55
    New Member
    Join Date
    Aug 2007
    Posts
    2

    Exclamation Re: Create Virtual Directory in IIS using VB.NET

    Hi Chaps,

    I'm new to this site and registered purely on the back of this excellent piece of work to create virtual directories in VB.NET.

    But, I'm having a problem with the RPC issue.

    I can't just turn the firewall off (company policy I'm afraid! ).

    Is there any further developments with getting round this RPC issue? Are there any exceptions I should set within Windows Firewall to allow this IIS change from the application I've created?

    For further information, the error I receive is this:-

    System.Runtime.InteropServices.COMExeption occured in system.directoryservices.dll

    Additional information: The RPC server is unavailable.

    This occurs on the following line within the code:

    Dim CanCreate as Boolean = Not IISSchema.Properties("Syntax").Value.ToString.ToUpper() = "Boolean"

    Any help would be really appreciated!

    Thanks

  16. #56

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,633

    Re: Create Virtual Directory in IIS using VB.NET

    Hi and welcome

    This is a tricky one. It can be caused by many many things. Firewalls just being one of them
    Does your company use a 3rd party firewall? If so, turning off the windows firewall may fix the issue.
    Not exactly sure what ports need to be open I am afraid

    If you run this on the web server itself do you get the errors?

    Woka

  17. #57
    New Member
    Join Date
    Aug 2007
    Posts
    2

    Re: Create Virtual Directory in IIS using VB.NET

    I'm not sure exactly how their firewall is set up. It's quite a big company (British Telecom!!! lol).

    I'm writing a system to automate the installation of a web application we have developed. Part of the automation is to manipulate IIS and create the virtual directories.

    The script has been ran from the web server itself (i.e. localhost) but still this RPC error is returned.

    I will do some investigating myself and if I find a solution I'll post it. I'm not holding my breath though!

    Cheers

  18. #58

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,633

    Re: Create Virtual Directory in IIS using VB.NET

    hehe. BT. I was working there not so long ago and they have some of the most locked down environments I have ever seen.
    Have you heard of HMC, Hosted Message Collaboration? or MPS, Microsoft Provisioning System?
    I did some overview dev training on these products for BT a few months ago.
    MPS was designed to provision resources in your environment...any resources.
    Have a word with ppl at BT and see if they have heard of HMC....if so, use that

    So, you also got the error on the local IIS box? doesn't sound good.
    Does the local IIS box have windows firewall running?

    Woka

  19. #59
    New Member
    Join Date
    Aug 2001
    Posts
    4

    Re: Create Virtual Directory in IIS using VB.NET

    In order for the App Name to be populated correctly, you have to swap these two lines
    VDir.CommitChanges()
    VDir.Invoke("AppCreate", 1)

    Should be
    VDir.Invoke("AppCreate", 1)
    VDir.CommitChanges()

    If you don't swap the two lines, the AppFriendlyName will appear blank when you look at the properties of your Virtual Directoy.

    Other than that, excellent code. Thanks

  20. #60

  21. #61
    New Member
    Join Date
    Feb 2008
    Posts
    1

    Re: Create Virtual Directory in IIS using VB.NET

    Hi Woka..
    I only registered to this site to say thank you for the post. Two years later and it's still working and helping people like me. Thank you to all of you. I rewrite the code in c# but for some reason I couldn't figure out it's not working. So I decided to write it in VB.Net and use it as a DLL, which is working perfectly. Weird isn't it?

    ---
    Sergio

  22. #62
    New Member
    Join Date
    May 2006
    Posts
    10

    Re: Create Virtual Directory in IIS using VB.NET

    I was wondering if anyone knows how to add an IIS 6 web site with Host Header?

  23. #63
    New Member
    Join Date
    Jul 2010
    Posts
    2

    Re: Create Virtual Directory in IIS using VB.NET

    Hi Woka! Thanks for letting us use the code I really appreciate it. The code seemed to be working when I was running it through visual studios, but after we uploaded onto the server I am getting the RPC unavailable error. I'm not sure what to do to fix this, we checked the firewall and are logging in as administrator so I'm not sure what else can be the problem. Do you have any ideas? Here is the stack trace error that follows:
    [COMException (0x800706ba): The RPC server is unavailable.
    ]
    System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) +377678
    System.DirectoryServices.DirectoryEntry.Bind() +36
    System.DirectoryServices.DirectoryEntry.get_AdsObject() +31
    System.DirectoryServices.PropertyValueCollection.PopulateList() +26
    System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry entry, String propertyName) +49
    System.DirectoryServices.PropertyCollection.get_Item(String propertyName) +150
    MFC.WebApp.SecureAuth.WebAdminWorkflow.CreateVirtualDir(String WebSite, String AppName, String Path) +192
    MFC.WebApp.SecureAuth.WebAdminWorkflow.AddInstanceButton_Click(Object sender, EventArgs e) +239
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

  24. #64
    New Member
    Join Date
    Jul 2010
    Posts
    2

    Re: Create Virtual Directory in IIS using VB.NET

    Nevermind I found what was wrong. I was hardcoding the name for my box while I was coding instead of putting the localhost name. Everything seems to be working fine now

  25. #65
    New Member
    Join Date
    Mar 2012
    Posts
    1

    Re: Create Virtual Directory in IIS using VB.NET

    Hi mate
    I dont know how old is this post. the code you wrote is great and works for me like charm the only problem is that i want to add the physical path credentials to the virtual directory with your code but i couldnt find anywhere what property should i use.
    greatest regards
    Last edited by tarzan_055; Mar 23rd, 2012 at 03:45 AM.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.