Click here to Skip to main content
15,903,854 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi.
I'm working on a windows forms app on my laptop. I have copied the file of the whole project to my Usb as backup and when I wanted to run the exe file from the debug folder on another pc it just won't start. The earlier version of my app was working on another pc but since I added some dlls (to be specific XtremeDocumentStudio.NET - for viewing documents in the form) it won't start. I'm assuming that this is the code which disables the app:

C#
public Form1()
{
            InitializeComponent();
            button5.Enabled = false;
            button6.Enabled = false;
            button7.Enabled = false;
            button9.Enabled = false;
            button10.Enabled = false;
            textBox6.Enabled = false;
            Framework.ActivateLicense(licenseKey); // this line
}
Posted

There are many possible reasons why it may not work on another PC.
Start with the obvious ones:
1) Does the target PC have the right version of the .NET framework?
2) Did you include the DLL's that your app references with the EXE file (assuming you have the rights to distribute them)?
3) Do the DLL files require any licence installation before they will run?

Looking at the line you say disables it, it's most likely (3) and that implies that you don't have the rights you need for distribution of the DLL files.

If so, then they only people who can help you are the people who licence the DLL files - so talk to their tech support and explain the problem. There may be a simple solution, or you may have to change your licence: but only they can be sure.
 
Share this answer
 
Comments
PeMaCN 5-Dec-15 4:13am    
But I can run the exe file from Usb on my laptop. I also added this code minute ago: try{ Framework.ActivateLicense(licenseKey); }catch(Exception ex){ MessageBox.Show(ex.Message); } but nothing happens on other pc
Well, you have a few options

1. Remove the line that you think is causing the problem and then try to run the application.
At least it will give certainty.

2. Implement the event Form.Shown
C#
private Form1_Shown(object sender, EventArgs e)
{
    try
    {
        Framework.ActivateLicense(licenseKey);    
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.ToString());
    }
}

The advantage with this approach is that at least you will see the form loading before you run into the problem code.

3. It could also be a case of not having the correct .Net Framework version installed on "the other PC"
What Is the .NET Framework, and Why Do I Need It?[^]
 
Share this answer
 
v2
Comments
PeMaCN 5-Dec-15 4:32am    
1. solution - doesn't have results
I'm now trying 3rd solution but how is it possible that I have to install proper NET Framework on every PC that wil be using my app
George Jonsson 5-Dec-15 4:41am    
That is one of the points with the .Net Framework.
Instead of distributing a huge amount of assemblies every time you release an app, you instead use pre-installed assemblies.
See What Is the .NET Framework, and Why Do I Need It?[^]
PeMaCN 5-Dec-15 4:44am    
Is there a way I can evade this fact?
George Jonsson 5-Dec-15 4:52am    
Well, if you stick to .Net applications the correct Framework has to be installed.
You can write your application in unmanaged C++ and link all dependencies as static libraries.
Java has the same problem as .Net, it needs a pre-installed framework to execute.

What is the problem with installing the .Net Framework?
PeMaCN 5-Dec-15 4:57am    
I installed the .NET Framework on other PC and now it's working. Thank you for help.
What is the problem with installing the .NET Framework? Well, I just want to make the usement of app more easier to the users.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900