C # CodeProvider: add link to XNA?

I am creating a scripting engine for my game and I need C # scripts to have a reference to the Microsoft.XNA.Framework assembly so that I can inherit my own classes.

I am currently mistaken when I add a link to Microsoft.XNA.Framework.dll. This is my link adding code (I left a link to my own EXE, but it is.):

parms.ReferencedAssemblies.Add("System.dll");
parms.ReferencedAssemblies.Add("Microsoft.Xna.Framework.dll");
parms.ReferencedAssemblies.Add("Microsoft.Xna.Framework.Graphics.dll");
parms.ReferencedAssemblies.Add("mscorlib.dll");

And here my code will be compiled:

using System;
using Microsoft.XNA.Framework;
using Microsoft.XNA.Framework.Graphics;
namespace _2342 {
namespace Blocks {
    class MyClass : Block
    {
        public MyClass() {
        _name = "TestBlock";
        }
    }
}}

I get two errors from CodeProvider saying that none of the XNA DLLs were found.

How can i fix this?

+3
source share
2 answers

You mistakenly wrote the assembly name "Microsoft.XNA.Framework". It should be "Microsoft.Xna.Framework"

+1
source

. , , XNA GAC. -

ReferencedAssemblies.Add(@"C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.dll");

"C:\Program Files (x86)\Microsoft XNA" XNA-.

0

All Articles