Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6189031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:20:19+00:00 2026-05-24T02:20:19+00:00

I have a .NET class library (as a .dll file) and that library contains

  • 0

I have a .NET class library (as a .dll file) and that library contains a class with a static method. Is there a way to call that method from a command line?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T02:20:19+00:00Added an answer on May 24, 2026 at 2:20 am

    Here is a guide on how to load a dll from Powershell and call methods in it.

    The most important part of the post are these commands:

    [C:\temp]
    PS:25 > notepad MyMathLib.cs
    
    (…)
    
    [C:\temp]
    PS:26 > csc /target:library MyMathLib.cs
    Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
    for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
    Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.
    
    
    [C:\temp]
    PS:27 > [Reflection.Assembly]::LoadFile(“c:\temp\MyMathLib.dll”)
    
    GAC    Version        Location
    —    ——-        ——–
    False  v2.0.50727     c:\temp\MyMathLib.dll
    
    
    
    [C:\temp]
    PS:28 > [MyMathLib.Methods]::Sum(10, 2)
    12
    
    [C:\temp]
    PS:29 > $mathInstance = new-object MyMathLib.Methods
    Suggestion: An alias for New-Object is new
    
    [C:\temp]
    PS:30 > $mathInstance.Product(10, 2)
    20
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .NET class library containing a class with a method that performs
I have a C# Class Library (dll; .net 4.0). I'll call it mytestlib. I
I have an ASP.NET VB.NET web project that references a VB.NET class library. I
I have a C# (2008/.NET 3.5) class library assembly that supports WPF (based on
I have a class library written in .Net that I would like to make
i have a winsock component made with vb.net in a class library that has
I build a .NET Class Library project that accesses the mshtml.HTMLDocument when called (from
I have a vb.net 3.5 class library project that needs to reference two assemblies
i have created a com class library with vb.net. i have registered the dll
I have an asp.net mvc project and reference a dll to a class library.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.