1

This is my first time using Visual Studio, or async in C#. I am using Visual Studio 2015 with this added reference (Any CPU): https://github.com/kade-robertson/AnimmexAPI/releases/tag/0.0.3 .

I am trying to test this API on a Windows Form App, but whenever I run it I get the following message:

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in System.Windows.Forms.dll

Additional information: Could not load file or assembly 'AnimmexAPI, Version=0.0.3.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Here is the code I am trying to run:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using AnimmexAPI;

namespace AnimmexDownloader
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private async void button1_Click(object sender, EventArgs e)
        {
            var api = new AnimmexClient();
            var fellowshipVid = await api.ImFeelingLucky("fellowship of the ring");
            MessageBox.Show(fellowshipVid.ToString());
        }
    }
}
Community
  • 1
  • 1
  • Hey there! Creator of AnimmexAPI here :) My suggestion is to use the package that's available on NuGet now, it will handle the dependencies as well! – Kade Jan 24 '17 at 14:48

1 Answers1

1

The solution: rename AnimmexAPI-AnyCPU.dll to AnimmexAPI.dll and include it again to your solution. The explanation is actually given in this answer: Loading renamed C# assembly throws FileNotFoundException

Community
  • 1
  • 1
ViK
  • 26
  • 3