त्रुटि लॉग:"TypeInitializationException था बिना क्रिया"
System.TypeInitializationException was unhandled
Message="The type initializer for 'MaxDavidMP4.Program' threw an exception."
Source="MaxDavidMP4"
TypeName="MaxDavidMP4.Program"
StackTrace:
at MaxDavidMP4.Program.Main()
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.IO.FileNotFoundException
Message="Could not load file or assembly 'Microsoft.Xna.Framework, Version=3.1.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d' or one of its dependencies. The system cannot find the file specified."
Source="MaxDavidMP4"
FileName="Microsoft.Xna.Framework, Version=3.1.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d"
FusionLog="=== Pre-bind state information ===\r\nLOG: User = Max-PC\\Max\r\nLOG: DisplayName = Microsoft.Xna.Framework, Version=3.1.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d\n (Fully-specified)\r\nLOG: Appbase = file:///C:/Users/Max/Desktop/maximas save/School/University/CSS 450/MaxDavidMP4/MaxDavidMP4/bin/Debug/\r\nLOG: Initial PrivatePath = NULL\r\nCalling assembly : UWBGL_XNA_Lib10, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.\r\n===\r\nLOG: This bind starts in default load context.\r\nLOG: No application configuration file found.\r\nLOG: Using machine configuration file from C:\\Windows\\Microsoft.NET\\Framework64\\v2.0.50727\\config\\machine.config.\r\nLOG: Post-policy reference: Microsoft.Xna.Framework, Version=3.1.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d\r\nLOG: The same bind was seen before, and was failed with hr = 0x80070002.\r\n"
StackTrace:
at MaxDavidMP4.Model..ctor()
at MaxDavidMP4.Program..cctor() in C:\Users\Max\Desktop\maximas save\School\University\CSS 450\MaxDavidMP4\MaxDavidMP4\Program.cs:line 14
InnerException:
Program.cs कोड:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace MaxDavidMP4
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
///
static Model model = new Model();
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
public static Model getModel()
{
return model;
}
}
}
ऐसा लगता है इस मुद्दे को Microsoft.Xna.Framework 3.1.0 के साथ है समावेशन, लेकिन मुझे यकीन है कि पथ सही है, और मेरी सभी अन्य परियोजनाएं इस सेटअप के साथ ठीक काम करती हैं। यह वीएस 2008 में है, सी #, बीटीडब्ल्यू। मुझे याद है कि आखिरी बार मुझे यह मुद्दा था, मुझे वीएस 2008 में शीर्ष केंद्रीय ड्रॉपडाउन सूचियों में से एक को 'x86' में सेट करना पड़ा और इसे ठीक किया गया, लेकिन अब इससे कोई फर्क नहीं पड़ता।
डीबग पर क्लिक करें -> अपवाद और सभी फेंक दिए गए चेकबॉक्स पर जांचें। इससे आपको समस्या का निर्धारण करने में मदद मिलेगी। –