0

I am working on a text-based RPG in Visual Studio 2015 using C# and windows forms. I have created a class library for some basic math methods, and I want to reference said library in my forms solution.

I can enter the using statement with no issues on my forms solution. When I try to use a method from the class library, VS does not see it.

I have added the class library as a reference. My class library classes are public and static. I also have checked and confirmed that both solutions are targeting the same .Net framework.

Here is my form code.

using System;
using System.Collections.Generic;
using System.Drawing;
using MathOperationsLibrary;
using System.Windows.Forms;

namespace NewRPG
{
    public partial class GameScreen : Form 
    {
        public GameScreen()
        {
            InitializeComponent();

            // Red underline under 'Multiply'.
            Multiplication.Multiply(2,3);
        }
    {
}

And then my class library.

using System;

namespace MathOperationsLibrary
{
    public static class Multiplication
    {
        public static int Multiply(int x, int y)
        {
            return x * y;
        }
     }
}
Luke Puller
  • 11
  • 1
  • 2

0 Answers0