mardi 22 novembre 2016

Reference to Xna 4.0 library

I'm creating program to complie scripts(using Xna library) at runtime. But i have error after i add a reference to Microsoft.Xna.Framework.dll;

Code to add reference:

        cp.ReferencedAssemblies.Add("System.dll");
        cp.ReferencedAssemblies.Add("System.Linq.dll");
        cp.ReferencedAssemblies.Add("System.Data.dll");
        cp.ReferencedAssemblies.Add("System.Xml.dll");
        cp.ReferencedAssemblies.Add("mscorlib.dll");
        cp.ReferencedAssemblies.Add("System.Drawing.dll");
        cp.ReferencedAssemblies.Add("System.Collections.dll");
        cp.ReferencedAssemblies.Add("System.Windows.Forms.dll");
        cp.ReferencedAssemblies.Add("WindowsGame1.exe");
        cp.ReferencedAssemblies.Add(@"C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Graphics.dll");
        cp.ReferencedAssemblies.Add(@"C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Game.dll");

Scritp code with i want to compile :

using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WindowsGame1
{
    class Enemy         
    {
       public Enemy()
       {
       }
    }
}

When i run program i have this error :

c:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll: (Location of symbol related to previous error)

I try to delete mscorlib.dll from solution References but when i did thi, i saw this error : e:\Project\WindowsGame1\WindowsGame1\bin\x86\Release\WindowsGame1.exe: (Location of symbol related to previous warning)

Do you know how can I fix this?





Aucun commentaire:

Enregistrer un commentaire