Sign in to follow this  
Chris27

namespace Framework?

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this