locked
.exe is not showing program expected output RRS feed

  • Question

  • Environment :

    1) Visual Studio 2017 Community

    2) Window 7, 64 bit

    3) Python version 3.6.5

    ===

    Hello, developer, I am trying to implement Visbrain, which is a Python 3 package by in my c# window form program.

    After i finish developing my Program, I  created an .exe file from the project.

    After that, i go to another PC, set up the environment to run that .exe file.

    It did not show me the output that i expected. 

    I open the program by using Visual Studio 2017 Community and I DID NOT CHANGE THE CODE OF MY PROGRAM.

    I build the program and it shows the output that i expected

    after that, I run the .exe file that i created in the beginning, It also pops out the output that i expected.

    I refer to these, but still can't solve this issue.
    1) https://social.msdn.microsoft.com/Forums/vstudio/en-US/0699b2fd-b505-4166-979e-677e2862bf01/how-can-i-create-an-exe-file-from-a-visual-studio-project?forum=csharpgeneral
    2) documentation on how to create setup program

    Would like to ask that, is there any way to create .exe that can provide output as i expected ?

    Thank You.

    Tuesday, August 21, 2018 4:58 PM

All replies

  • Hi STREETKILLER007,

    According to your description, you create .exe and go to another pc to run this .exe, but the results you get are not the same as the results of the debug in the development environment, am I right?

    If yes, please confirm that this pc .net framework version, there may be some dlls can run in sepcific .net framework version.

    If you can, please provide some code here, I will try to help you to test it.

    Best Regards,

    Cherry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, August 22, 2018 5:46 AM
  • Sorry for late reply.

    I am wondering is it possible to send you my program file for you to test it out.

    Because i think it is easier if i can post the difference between the output.

    ===

    Firstly, i will try to explain what i have done on setup the environment.

    1) install python

    i had installed python 3.6.6, 64 bit in my code.

    2) setup visbrain

    after downloaded and installed python 3.6.6, just type following in sequence :

    • pip install numpy scipy
    • pip install matplotlib pyqt5 vispy pillow
    • pip install visbrain

    ===

    I had included Python.Runtime.dll as reference.

    since this is a window form, so the below code will be execute after "Analysis" button is pressed.

    // initialize python engine
    PythonEngine.Initialize();
    
    using (Py.GIL())
    {
    
                    // import visbrain
                    dynamic myVisbrain = Py.Import("visbrain");
                    Console.WriteLine("hi visbrain");
    
                    // import topo from Visbrain
                    dynamic myTopo = myVisbrain.Topo();
                    Console.WriteLine("hi topo");
    
                    // Create a list of channels, data, title and colorbar label :
                    dynamic exampleName = "test topo";
                    dynamic exampleTitle = "topoplot";
                    dynamic exampleCblabel = "Colorbar label";
                    dynamic exampleChannels = new List<String> { "C3", "C4", "Cz", "Fz", "Pz" };
                    dynamic exampleData = new List<Double> { 10, 20, 30, 10, 10 };
    
                    // Add a central topoplot :
                    myTopo.add_topoplot(exampleName, exampleData, Py.kw("channels", exampleChannels), Py.kw("title", exampleTitle), Py.kw("cblabel", exampleCblabel)); // example
                    Console.WriteLine("test add_topoplot example");
    
                    // show
                    myTopo.show();
    }

    And this is the example from Visbrain documentation.

    Thank You.

    Friday, August 24, 2018 10:47 AM