Take the 2-minute tour ×

I moved a typed dataset from one project to an ASP Web Application project. I put the typed dataset into one of the existing directories as it was in the App_Code directory of the previous site but don't see the option to create that asp.net folder in this project.

Now, when I try to instantiate the typed dataset, the compiler says 'The type or namespace name '' could not be found (are you missing a using directive or an assembly reference?)'.


share|improve this question
add comment

4 Answers

up vote 4 down vote accepted

You may need to re-gen the DataSet. When you move the .xsd, you've only moved the xml layout of the DataSet.

Delete any generated code file, open the xsd, move something, and then save it. The save operation calls the generator. Or you can right-click on the .xsd file and call the generator directly.

share|improve this answer
Just to clarify - this does work. You can expand the XSD in the Solution Explorer, and simply delete the Designer.vb file. Then open your dataset (XSD file) and drag the dataset a little bit. Then Save. I couldn't see what it actually changes in the Designer file. –  Joe N Oct 18 '10 at 23:01
add comment

Make sure the compiler knows it's a dataset and not just an Xml file. Select the DataSet.xsd in Solution Explorer, then in the Project window ensure that "Custom Tool" is set to MSDataSetGenerator.

After that, instead of guessing, open up the dll file in Reflector and look for your DataSet class. Make sure it's in the namespace you think it is.

share|improve this answer
I had a blank CustomTool setting, so no code was getting generated. This fixed it, cheers –  codeulike Apr 1 '11 at 16:33
add comment

You have included the "using namespace" statement in the new code?

share|improve this answer
Yes. When I did that and the compiler says 'Type or namespace name not be found <namespace>'. I referenced newly imported classfiles from another namespace just fine. The typed dataset is the only file so far it it's namespace. –  Bill Martin Dec 31 '08 at 15:03
Confirm if there is namespace in a .cs file generated from .xsd (right-click on .xsd > "View Code"). There is a "Custom Tool Namespace" you can specify in XSD file properties - check out if assigning it helps. –  DK. Dec 31 '08 at 16:30
add comment

I moved my web site to a Web Application Project and experienced the same issues. I took the approach mentioned in the first answer and was able to get the project to compile eventually. I would like to add a little more detail to the first answer.

To be explicit: I first deleted all of the files associated with the xsd file except for the xsd file itself (the xss, xsc, cs, ...). I then right-clicked on the xsd file, selecting "View Designer" and then "View Code", and then "Run Custom Tool". All of the files were re-gened and the references compiled.

share|improve this answer
add comment

Your Answer


