Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

neStorm

DirectX 9 and C# - Problem loading reference

This topic is 5404 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I need help with this! It''s regarding DirectX. I''m just getting started. I think that I''ve done almost everything I can. I''m beginning to think that it has something to do with file permissions for some reason. I''ve tried placing the .dll inside the project''s /bin folder and re-referencing, no improvement was made. I don''t understand WHY it is telling me this! The files are there... ### HERE IS WHAT I''M RUNNING ### Microsoft Visual C# .NET DirectX extensions for Visual Studio Windows XP Professional SP1 ### HERE IS THE ERROR ### ''DefaultDomain'': Loaded ''c:\windows\microsoft.net\framework\v1.0.3705\mscorlib.dll'', No symbols loaded. ''WindowsApplication1'': Loaded ''C:\Development\Programming\C#_ASP.NET\WindowsApplication1\bin\Debug\WindowsApplication1.exe'', Symbols loaded. ''WindowsApplication1.exe'': Loaded ''c:\windows\assembly\gac\system.windows.forms\1.0.3300.0__b77a5c561934e089\system.windows.forms.dll'', No symbols loaded. ''WindowsApplication1.exe'': Loaded ''c:\windows\assembly\gac\system\1.0.3300.0__b77a5c561934e089\system.dll'', No symbols loaded. ''WindowsApplication1.exe'': Loaded ''c:\windows\assembly\gac\system.drawing\1.0.3300.0__b03f5f7f11d50a3a\system.drawing.dll'', No symbols loaded. An unhandled exception of type ''System.IO.FileNotFoundException'' occurred in WindowsApplication1.exe Additional information: File or assembly name Microsoft.DirectX.Direct3D, or one of its dependencies, was not found. Unhandled Exception: The program ''[316] WindowsApplication1.exe'' has exited with code 0 (0x0). System.IO.FileNotFoundException: File or assembly name Microsoft.DirectX.Direct3D, or one of its dependencies, was not found. File name: "Microsoft.DirectX.Direct3D" at WindowsApplication1.Form1..ctor() at WindowsApplication1.Form1.Main() in c:\development\programming\c#_asp.net\windowsapplication1\form1.cs:line 69 ### HERE IS THE CODE ###

using System;

using System.Drawing;

using System.Collections;

using System.ComponentModel;

using System.Windows.Forms;

using System.Data;

using Microsoft.DirectX;

using Microsoft.DirectX.Direct3D;



namespace WindowsApplication1

{

	/// 

	/// Summary description for Form1.

	/// 

	public class Form1 : System.Windows.Forms.Form

	{

		/// 

		/// Required designer variable.

		/// 

		private System.ComponentModel.Container components = null;

		private Device device = null;



		public Form1()

		{

			//

			// Required for Windows Form Designer support

			//

			InitializeComponent();



			//

			// TODO: Add any constructor code after InitializeComponent call

			//

		}



		/// 

		/// Clean up any resources being used.

		/// 

		protected override void Dispose( bool disposing )

		{

			if( disposing )

			{

				if (components != null) 

				{

					components.Dispose();

				}

			}

			base.Dispose( disposing );

		}



		#region Windows Form Designer generated code

		/// 

		/// Required method for Designer support - do not modify

		/// the contents of this method with the code editor.

		/// 

		private void InitializeComponent()

		{

			this.components = new System.ComponentModel.Container();

			this.Size = new System.Drawing.Size(300,300);

			this.Text = "Form1";

		}

		#endregion



		/// 

		/// The main entry point for the application.

		/// 

		[STAThread]

		static void Main() 

		{

			using(Form1 frm = new Form1()) 

			{

				//Show our form and initialize our graphics engine

				frm.Show();

				frm.InitializeGraphics();

				Application.Run(frm);

			}

		}



		public void InitializeGraphics() 

		{

			//Set the presentation parameters

			PresentParameters presentParams = new PresentParameters();



			presentParams.Windowed = true;

			presentParams.SwapEffect = SwapEffect.Discard;



			//Create the device

			device = new Device(0,DeviceType.Hardware,this,CreateFlags.SoftwareVertexProcessing,presentParams);

		}



		protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)

		{

			device.Clear(ClearFlags.Target,System.Drawing.Color.CornflowerBlue,1.0f,0);

			device.Present();

		}

	}

}

 
- neStorm

Share this post


Link to post
Share on other sites
Advertisement
Right click on references, click add, find Microsoft.DirectX and Microsoft.DirectX.Direct3D. Add them both.

technic

Share this post


Link to post
Share on other sites
You shouldn''t need to copy the dlls locally into your project bin directory, although that is strange that it is failing to load the assembly.

Try deleting your references and deleting the DirectX DLLs out of your bin folder. Then re-add the references by just adding them straight from the add reference dialogue (i.e. just select them from the list and don''t browse for them).

Share this post


Link to post
Share on other sites
They are not in the normal list, I have to use the browse option. I have tried deleting and re-referencing, this doesn't fix the issue. It's something else. Any other suggestions?

I am running .NET 1.1+ / SP2 and Directx 9 Update / SDK. Everything should be up to date.

The error doesn't make any sense. The code itself is very simple, I don't know what else to do besides re-install everything. -- I REALLY don't want to do this.

- neStorm

[edited by - nestorm on February 27, 2004 9:32:48 AM]

Share this post


Link to post
Share on other sites

You are referencing the 1.0.1901.0 version.

Have you the 1.0.900.0 version in your reference. If yes, try to use instead. If not, before reintalling everything try to uninstall just your directx sdk. Download the latest version of the sdk 9.0b (summer 2003) and install it.

Share this post


Link to post
Share on other sites
The DirectX assemblies should appear in the standard list. Did you install Visual Studio after installing the SDK? Maybe reinstalling the SDK would help.

technic

Share this post


Link to post
Share on other sites
I installed the SDK after Visual Studio.

1.0.1901.0 is not the latest version??

I believe that I downloaded the DirectX 9 Update SDK from Microsoft. I will try to update the SDK when I get home today, if 1.0.1901.0 is not the newest version that may be the cause.

Any other ideas??

I appreciate the help.

- neStorm

Share this post


Link to post
Share on other sites
As a last ditch effort you could try copying the DirectX Dlls into the GAC (c:\winnt\assemblies).

But first I would try reinstalling the DirectX SDK Summer Update and then re-referencing those DLLs.

technic

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!