locked
Running An Application

    Question

  • After I compile the application i can run it from my desktop and other develop desktops just by using the exe without installing the application.

    One of the developers is now workstation in a diferent department and tries to run the exe, he gets this error.

    to run this application, you first must install on of the following versions of the .NET Framework:

    v2.0.5727

    contact you applicaion publisher for obtaining the appropriate version of the .Net Framework.

    I am assume this because VS2005 isn't installed on the machine he is using that is why he is having the problem, I also gues it is because i haven't run a install program either.  My question is in order to just run the exe on non-development machines do i have to create an install package?

    Tuesday, February 27, 2007 2:57 PM

Answers

  • It looks like the problem is the server path you're using. It's evaluating this as a "Local Intranet" zone and this will cause the application to run at a reduced trust level. What you can do is the following taken from a KB article that deals with a related problem in ASP.NET applications:


    1. On the system where you want the application to run, open Administrative Tools, and then double-click Microsoft .NET Framework Configuration.

    2. Expand Runtime Security Policy, expand Machine, and then expand Code Groups.

    3. Right-click All_Code, and then click New.

    4. Select Create a new code group. Give your code group a relevant name, such as the name of the applications share. Click Next.

    5. In the Choose the condition type for this code group list, select URL.

    6. In the URL text box, type the path of the share in the following format (where computername is the name of the computer that is hosting the remote share, and sharename is the name of the share):  file:////\\computername\sharename\*

    7. Click Next. On the next page, select Use an existing permission set, and then select FullTrust.

    8. Click Next, and then click Finish.


     

     

    Friday, March 02, 2007 6:00 PM

All replies

  • The .Net framework needs to be installed for the computer to be able to handle .Net applications. You can download it for free from the Microsoft site: http://msdn2.microsoft.com/en-us/netframework/aa569294.aspx
    Tuesday, February 27, 2007 3:36 PM
  •  ChristianBG wrote:
    My question is in order to just run the exe on non-development machines do i have to create an install package?

    If the appropriate .net framework is already installed and you are not using any com references ...then no you do not have to create an install package....XCopy deployment will work. 

    Tuesday, February 27, 2007 3:37 PM
  • the problem now is that the program doesn't ahve the correct permissions to run.

    I get this error system.security.exception.

    on those machines without visual studio don't let me or i can't find a way to adjust the security in the framework policies

    Friday, March 02, 2007 2:50 PM
  • What is the exect error you are getting?  Check local or group policies to make sure there is nothing that would prevent this application from running.  Figure out what is causing this error.  What is this app trying to access that would throw this type of exception?  Is it trying to access the file system?  A network resource?  Or ?
    Friday, March 02, 2007 3:05 PM
  •  ChristianBG wrote:

    the problem now is that the program doesn't ahve the correct permissions to run.

    I get this error system.security.exception.

    on those machines without visual studio don't let me or i can't find a way to adjust the security in the framework policies

    Double Click on "MyProject" and then the Security Tab

    Friday, March 02, 2007 3:06 PM
  • system.invalidoperationexception

    is the error i get on a machine with out vs2005 installed, then when i run it on an machine with VS I get the same error and it allows me to debug and i can get into the error and see that it is a security issue when the program first launches and tries to get in the microsoft.visualbasic.dll

    i went into the framework 2.0 configuration and set the policy to allow full trust and it ran fine.  I am very confussed.  How do you set the strong name?

    Friday, March 02, 2007 3:27 PM
  • i tried that also it didn't change anything.  the error is happening when the program first launches and tries use the microsoft.visualbasic.dll.  This is all code i converted over from vb6 and i am new to vb.net.  i haven't set a strong name or atleast don't recall doing that.  Is there another way i can go about solving this problem.

    When i create an install package it runs fine.  be are trying to avoid that for the time being and keep the exe on the server so everybody can access it from there this way when we do updates every can get it instantly with out un-installing and reinstalling.  I have also created a clickonce publish routine but i since i don't have a website or ftp server to run the files from i don't think it likes \\myServer\myAppLocation\ so i am totally confussed as how to proceed.

     

    Friday, March 02, 2007 3:36 PM
  • It looks like the problem is the server path you're using. It's evaluating this as a "Local Intranet" zone and this will cause the application to run at a reduced trust level. What you can do is the following taken from a KB article that deals with a related problem in ASP.NET applications:


    1. On the system where you want the application to run, open Administrative Tools, and then double-click Microsoft .NET Framework Configuration.

    2. Expand Runtime Security Policy, expand Machine, and then expand Code Groups.

    3. Right-click All_Code, and then click New.

    4. Select Create a new code group. Give your code group a relevant name, such as the name of the applications share. Click Next.

    5. In the Choose the condition type for this code group list, select URL.

    6. In the URL text box, type the path of the share in the following format (where computername is the name of the computer that is hosting the remote share, and sharename is the name of the share):  file:////\\computername\sharename\*

    7. Click Next. On the next page, select Use an existing permission set, and then select FullTrust.

    8. Click Next, and then click Finish.


     

     

    Friday, March 02, 2007 6:00 PM