# Unity [.net] New C# project with DirectX (problems with wizard)

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

## Recommended Posts

I started this thread originally in the DirectX forum (I didn't know about this .NET one). http://www.gamedev.net/community/forums/topic.asp?topic_id=291744 Anyway, here's my problem. I'm trying to learn some C# and managed DirectX so I set up a new "DirectX 9 Visual C# Wizard" project in VS.NET. No matter what options I set in it, I can't get it to compile. I get the following errors:
------ Build started: Project: Editor, Configuration: Debug .NET ------

Preparing resources...
Updating references...
Performing main compilation...
C:\Documents and Settings\beoch\My Documents\My Projects\Editor\d3dfont.cs(40,13): error CS0246: The type or namespace name 'TextureState' could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\beoch\My Documents\My Projects\Editor\d3dfont.cs(41,13): error CS0246: The type or namespace name 'TextureState' could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\beoch\My Documents\My Projects\Editor\d3dfont.cs(42,13): error CS0246: The type or namespace name 'Sampler' could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\beoch\My Documents\My Projects\Editor\d3dapp.cs(62,15): error CS0246: The type or namespace name 'SamplerStates' could not be found (are you missing a using directive or an assembly reference?)
C:\Documents and Settings\beoch\My Documents\My Projects\Editor\d3dapp.cs(63,15): error CS0246: The type or namespace name 'TextureStates' could not be found (are you missing a using directive or an assembly reference?)

Build complete -- 5 errors, 0 warnings
Building satellite assemblies...
Satellite assemblies could not be built because the main project output is missing.

---------------------- Done ----------------------

Build: 0 succeeded, 1 failed, 0 skipped


Why won't this compile out of the box? I haven't touched a thing and I have the latest DirectX 9 SDK installed.

##### Share on other sites
Be sure the Microsoft.DirectX.Direct3D assembly is being referenced. Look at the "Reference" folder in the Solution Explorer. And the "using Microsoft.DirectX.Direct3D" in the code. This one, I think, is similar to WhiteScorpion's problem on the thread "Using DirectX9"

I know at this moment you just want to see a working DX app and probably that's the reason why you used the Wizard. Wizard are nice if you know what they are doing. For beginners, you're better off staying away from the wizards. Magic aint the way :)

##### Share on other sites
I don't think that's the problem. I read that post but it didn't seem to apply. I have a bunch of references listed in my project (including that one). When I browse through the Direct3D reference thing, it has a ton of stuff in it but it does not have TextureState in it. So something is messed up because I would expect wizard code to work...

I am using the wizard to see how they get a directx project up and running. I probably will junk this project once I figure out what's going on and start from scratch. But yeah, I just want to see something on the screen at this point. :) Thanks for the suggestion.

##### Share on other sites
Can you post some of the code in question as well as the using statements for the code.

Also try putting the fullnamespace call infront of the call in the projects..

ie, Microsoft.Directx.Diect3D.Device(xxx..)

This will bypass the using statements and test if you have them in correctly.

The last thing, What version of DirectX are you using, becuase the Wizards were removed about 2 maybe three versions ago.

##### Share on other sites
I agree with Mykre. Why not post the wizard-generated code instead. Try retyping the "TextureState" just to see if autocomplete fires. If it does fire you're safe otherwise, it must be reference/assembly, "using" things.

##### Share on other sites
If the wizards are obsolete, that could explain the problem. The code is just some wizard generated code. I would post the code in question but my hard drive died this afternoon (and I was just going to start backing things up onto DVD this week!! :( ). So I'm out of luck at the moment...

1. 1
Rutin
44
2. 2
3. 3
4. 4
5. 5

• 11
• 9
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632983
• Total Posts
3009714
• ### Who's Online (See full list)

There are no registered users currently online

×