Call VB.Net Console method in Power shell RRS feed

  • Question

  • I made console application using and I am able to run this application successfully.

    But I am unable to run this application using PowerShell script. Below are the my brief functionality:

    I need to pass the one parameter and it will return one boolean value. (Also I need to read the configuration file to load the some parameters).

    • Moved by jrv Tuesday, March 27, 2018 2:09 PM Corect forum.
    Tuesday, March 27, 2018 1:57 PM

All replies

  • Loading an EXE will not allow you to access it as an assembly.  You need to create a DLL that is structured correctly with public classes and methods.

    I will move this to the VB.Net developer forum since you issue is with using VB.Net to create an assembly.


    Tuesday, March 27, 2018 2:09 PM
  • Thank You!

    I have created DLL and I am getting issue with config file read.

    Can you please help me on how to read config file using DLL?

    Tuesday, March 27, 2018 2:38 PM
  • Are you asking about the APP.CONFIG file?  That config file only applies to the main executable.  PowerShell has an "app.config" file in its home folder. You would have to place items in that which is not recommended as it can cause conflicts.

    Perhaps you should look into using embedded resources or an external XML file for configuration data.


    Tuesday, March 27, 2018 2:46 PM
  • You cannot create a DLL using a console application with VB. Therefore make at least clear what you are doing. What you tell currently gives more the idea you want no answer. 


    Tuesday, March 27, 2018 2:47 PM