We're working on a WPF project using Visual Studio 2015. We've got a folder in the project named Assets. It shows up fine in VS 2015. The files in it show up fine in the Solution Explorer. But when we build it, VS 2015 complains with the following error:
"Error CS0234 The type or namespace name 'Assets' does not exist in the namespace 'CoreFramework' (are you missing an assembly reference?)"
(CoreFramework is the name of our solution and the project that Assets is in.)
I don't get how the folder is there in CoreFramework, but when building it, VS 2015 just doesn't see it. I've tried cleaning both the project and the solution in VS 2015, but it doesn't help at all. The same errors keep popping up. And they popup in our nightly builds as well.
So what is causing VS 2015 to simultaneously see a folder within a project and not see that same folder in the project?
To fix this error, simply update the example . csproj file to use a previous System. CommandLine version. Note that this package is only used to parse the options for the example.
This often occurs because the casing used in the name of the type is not correct. For example, Dataset ds; generates CS0246 because the s in Dataset must be capitalized. If the error is for a type name, did you include the proper using directive, or, alternatively, fully qualify the name of the type?
In this case what I had to do was to delete everything in the obj folder beneath our project main folder. The solution's name is CoreFramework and the main project's name is also CoreFramework. So what I did was go to \CoreFramework\CoreFramework\obj and deleted everything there. Since at this point we're only dealing with a debug version, the only thing there was the Debug folder and all temporary files and folders under that. Once I did that, then rebuilding the solution re-created all of the temporary files and folders, without the problem I was having with the Assets folder. It built fine.
YMMV
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With