namespace Framework?

Started by
4 comments, last by Adam Hamilton 17 years, 4 months ago
I've been going through a web tutorial using windows forms, C#, and directx. I'm having some problems with a missing namespace/assembly reffernce framework. Here is the link for the tutorial. http://msdn.microsoft.com/coding4fun/gaming/arcade/article.aspx?articleid=938703 ------ Build started: Project: BattleTank2005, Configuration: Debug Any CPU ------ C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:"..\..\..\..\..\..\..\Program Files\Microsoft DirectX SDK (October 2006)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.AudioVideoPlayback.DLL" /reference:"..\..\..\..\..\..\..\Program Files\Microsoft DirectX SDK (October 2006)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.Diagnostics.DLL" /reference:"..\..\..\..\..\..\..\Program Files\Microsoft DirectX SDK (October 2006)\Developer Runtime\x86\DirectX for Managed Code\Microsoft.DirectX.Direct3D.DLL" /reference:"C:\WINDOWS\Microsoft.NET\DirectX for Managed Code\1.0.2902.0\Microsoft.DirectX.Direct3DX.dll" /reference:"C:\WINDOWS\Microsoft.NET\DirectX for Managed Code\1.0.2902.0\Microsoft.DirectX.DirectDraw.dll" /reference:"C:\WINDOWS\Microsoft.NET\DirectX for Managed Code\1.0.2902.0\Microsoft.DirectX.DirectInput.dll" /reference:"C:\WINDOWS\Microsoft.NET\DirectX for Managed Code\1.0.2902.0\Microsoft.DirectX.DirectPlay.dll" /reference:"C:\WINDOWS\Microsoft.NET\DirectX for Managed Code\1.0.2902.0\Microsoft.DirectX.DirectSound.dll" /reference:"C:\WINDOWS\Microsoft.NET\DirectX for Managed Code\1.0.2902.0\Microsoft.DirectX.dll" /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Deployment.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.Mobile.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /debug+ /debug:full /optimize- /out:obj\Debug\BattleTank2005.exe /resource:obj\Debug\BattleTank2005.GameEngine.resources /resource:obj\Debug\BattleTank2005.Properties.Resources.resources /target:winexe AssemblyInfo.cs dxmutmisc.cs GameEngine.cs Program.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs C:\Documents and Settings\Chris\My Documents\Visual Studio 2005\Projects\BattleTank2005\BattleTank2005\dxmutmisc.cs(1365,36): error CS0227: Unsafe code may only appear if compiling with /unsafe C:\Documents and Settings\Chris\My Documents\Visual Studio 2005\Projects\BattleTank2005\BattleTank2005\dxmutmisc.cs(1694,37): error CS0227: Unsafe code may only appear if compiling with /unsafe C:\Documents and Settings\Chris\My Documents\Visual Studio 2005\Projects\BattleTank2005\BattleTank2005\dxmutmisc.cs(2189,61): error CS0246: The type or namespace name 'Framework' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Chris\My Documents\Visual Studio 2005\Projects\BattleTank2005\BattleTank2005\dxmutmisc.cs(2364,29): error CS0227: Unsafe code may only appear if compiling with /unsafe C:\Documents and Settings\Chris\My Documents\Visual Studio 2005\Projects\BattleTank2005\BattleTank2005\dxmutmisc.cs(2398,28): error CS0227: Unsafe code may only appear if compiling with /unsafe This happens after I add dxmutmisc.cs which is a namespace that contains a timer that you need to use in the program. I'm using visual studio 2005 and seem to be missing a reference or am not pointing to a folder that contains assembly refferences for the files in the project. I'm new to using directx so it's been a struggle to the sdk. Thanks
Advertisement
Have you added the DirectX .dlls to your reference folder? In Visual Studio in the Solution Explorer, expand and check the References folder. You should have all of the DirectX .dlls referenced there. If not, you can right click and add which will bring up a dialog box which lets you add the .dlls you need.
I've added all the directx files from the sdk runtime folder. I've also copied all the library and include files from the sdk to the folders in the visual studio folders. Do I also need to download the C# SDK?
You need to use the Managed DirectX libraries not the unmanged ones when doing C# development. The Augest 2006 DirectX sdk has the latest managed libs.

theTroll
Thanks. I'll try that.
Quote:Original post by Roof Top Pew Wee
Have you added the DirectX .dlls to your reference folder? In Visual Studio in the Solution Explorer, expand and check the References folder. You should have all of the DirectX .dlls referenced there. If not, you can right click and add which will bring up a dialog box which lets you add the .dlls you need.


There is only one now (Since some DirectX 9.0 release), you don't need to reference all the DirectX .dll files. Check to see if you have a Microsoft.DirectX.dll with a version of 2.0.0.0 and only reference this file for DirectX needs.

If you don't have a Microsoft.DirectX version 2.0.0.0 then you may need to download the latest Managed DirectX SDK.


This topic is closed to new replies.

Advertisement