Results 1 to 20 of 20

Thread: Use a VB.NET app. located on a server

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2004
    Posts
    369

    Use a VB.NET app. located on a server

    Hi,

    I want to install my VB.NET application on a server, so that 10-15 client PC will only have a shortcut on their desktop targeting the .exe file on the server.

    I don't want to install the app on the 10-15 PC and run their own .exe. It's too complex when there is an update of the .exe I have to recopy the file to each station.

    --

    Anyone has a good URL explaining how to do that?

    I guess I at least have to install the .NET framework on every PC. But for the rest, I need some help.

    Right now, I can run my application directly on the server, but when I call the .exe from another client-pc, it doesn't work.


    Thanks for helping.

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Use a VB.NET app. located on a server

    Did you place the framework on the workstation? As long as it points to the right location of the files on the server, I'd think it should work. What error are you getting?

  3. #3
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Use a VB.NET app. located on a server

    I had problems with this at a customer site also - something about the .EXE's credentials?

    Is that the error you are getting?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  4. #4
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Use a VB.NET app. located on a server

    you need to do 2 things (well 3)

    1) .NET framework MUST be installed on each client workstation...

    2) You need to setup permissions for the .NET framework on the client workstations to have full trust for your network app. By default network shares do NOT have full trust, and therefor will probably cause problems when running. In administrative tools (in control panel) you will find the "Microsoft .NET Framework 1.1 Wizards" In there you can give your app on the server the full trust it needs. You can automate this process if you have the network setup where your network admin can push out permissions as part of the users security policy.

    3) this one may not be needed, but if you used any COM references you need to make sure those COM DLLs are installed properly on the client workstation.


    My guess is #2 is what is causing your problem.

  5. #5
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Use a VB.NET app. located on a server

    Quote Originally Posted by kleinma
    2) You need to setup permissions for the .NET framework on the client workstations to have full trust for your network app. By default network shares do NOT have full trust, and therefor will probably cause problems when running. In administrative tools (in control panel) you will find the "Microsoft .NET Framework 1.1 Wizards" In there you can give your app on the server the full trust it needs. You can automate this process if you have the network setup where your network admin can push out permissions as part of the users security policy.
    Do you do that on the SERVER just once? Can you do it from the client PC and affect the SHARE FOLDER?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  6. #6
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Use a VB.NET app. located on a server

    it needs to be done from the client on each workstation...since what it is doing is modifying the security settings for the framework that exists on the local client machine...

  7. #7
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Use a VB.NET app. located on a server

    Quote Originally Posted by kleinma
    it needs to be done from the client on each workstation...since what it is doing is modifying the security settings for the framework that exists on the local client machine...
    Ok - I guess that makes sense since you said it could be pushed out as part of the users security

    We have a customer that has a lot of thin clients and an application server - does it get done just once from the APPLICATION SERVER - or from each logon from the application server?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  8. #8
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Use a VB.NET app. located on a server

    I am not sure if MS provides any methods for making it easy to admin .net apps running on an application server, they may.

    My experience in this, is primarily with network shares.

    Basically a lot of my customers have server machines setup with lots of clients machines that have a share on the server mapped to them. Lets call it the "S" drive on the clients machines...

    they install all the apps to the S drive, so they exists on the server, but get used from the clients. This type of setup will cause security exceptions on any client machine that has not configured their framework to give full trust to this application. The trust can be given in different ways, it could either be the exe specifically, the application folder, the entire shared drive, etc.... but this is a setting done FROM The client.

    The tool that actually manages permissions is called caspol.exe, MS may provide methods for using this in network environments so that you dont have to go to each workstation and make manual changes.. but I am not sure how one would go about this. My installer package (INNO) runs caspol when someone runs my app, to give it permissions needed if it gets installed to a network location. I just advise my customers to run the installation on each workstation to get the proper permissions setup. Its never really any issue for me since none of my clients generally have more than 5 PCs on their network.

  9. #9
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Use a VB.NET app. located on a server

    Thanks for the info!

    dbelley_office - sorry for taking off with your thread!

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  10. #10
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Use a VB.NET app. located on a server

    Quote Originally Posted by szlamany
    dbelley_office - sorry for taking off with your thread!
    its ok.. its most likely his issue anyway

  11. #11

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2004
    Posts
    369

    Re: Use a VB.NET app. located on a server

    Yeah its fine that you discuss it.
    My error is the following. In my super-simple application for test the error happens on the following line of code
    VB Code:
    1. Application.Exit

    This is the error: (its in french) but is a security thing.

  12. #12
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Use a VB.NET app. located on a server

    yep... application.exit requires FULL TRUST to execute....

    do what I described in #2 in my post above and you will not have that issue.


    you notice how the top exception is a securityexception.. this is why...

  13. #13

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2004
    Posts
    369

    Re: Use a VB.NET app. located on a server

    Hi,

    Sorry for being so dummy, but I went into the .Net Framework 1.1 Configuration.

    I don't exactly know from there what I have to do. I added the application on the network into the folder "Applications", I'm not even sure that is something I had to do ... but I don't know where to go to set full trust for that specific application.

    Thanks for helping again.
    After I will have done it once, I'll know for the future.

  14. #14
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Use a VB.NET app. located on a server

    No, go into the .NET framework Wizards (it will be easier for you)

    when you open that you get 3 icons, select the middle one "Trust an Assembly"

    follow through the prompts, and when it gets to the screen that asks for the trust level (there is a slider bar up and down) make sure you give it full trust.

    That should do it for ya.

  15. #15

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2004
    Posts
    369

    Re: Use a VB.NET app. located on a server

    Oh perfect !

    It works now, thanks a lot kleinma for your patience.

    But you know what? I have one more question !

    --

    I saw that if I go back with the wizard, I can change the trust of my assembly (my .exe file located on the server).

    But can I see that assembly now going with (.NET Framework 1.1 Configuration) ? I browsed a bit around and can't see my .exe anywhere.

  16. #16
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Use a VB.NET app. located on a server

    I don't think it shows up in there.

  17. #17
    Member
    Join Date
    Jan 2006
    Location
    UK
    Posts
    61

    Re: Use a VB.NET app. located on a server

    For creating permissions via caspol on remote machines you could try creating a .bat file that sets up the required permissions. Then apply this to all of the necessary computers via Active Directory Group Policy.

    This will also ensure that the policy is re-applied at regular intervals in case it gets altered by mistake (or by a malicious user).

    Chris Seary

  18. #18
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Use a VB.NET app. located on a server

    Quote Originally Posted by oldbear
    For creating permissions via caspol on remote machines you could try creating a .bat file that sets up the required permissions. Then apply this to all of the necessary computers via Active Directory Group Policy.

    This will also ensure that the policy is re-applied at regular intervals in case it gets altered by mistake (or by a malicious user).

    Chris Seary
    if you run caspol over and over again adding permissions, it creates a new entry for each one.

    When I run caspol during install of a .net app (using INNO) I always run caspol first to remove the permission set if its there, and then a second to put it back. Otherwise if it was run 10 times, it would have 10 entries.

  19. #19
    Member
    Join Date
    Jan 2006
    Location
    UK
    Posts
    61

    Re: Use a VB.NET app. located on a server

    This is correct. At the start of the .bat file, it's best to call caspol with the -reset parameter, which sets all policies back to their defaults. Also, use the polchgprompt off parameter, otherwise caspol will expect user input for each alteration.

  20. #20
    New Member
    Join Date
    Mar 2006
    Posts
    1

    Thumbs up Re: Use a VB.NET app. located on a server

    Kleinma,
    Thanks a lot.. I was having similar problem on a .NET app installed on network but unable to run from client machines..fantastic article used ur step #2 and worked straight away...very useful...keep it up .

    Cheers
    Preethi

Posting Permissions

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



Click Here to Expand Forum to Full Width