Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in a .g.cs file?

Tags:

c#

build

Error   1   The type or namespace name 'BreadcrumbLib' could not be found (are you missing a using directive or an assembly reference?) YOU_CAN'T_KNOW_THE_PATH_OR_NAME.g.cs    16  7   someWPFapp 

And the troublesome line is:

using BreadcrumbLib; 

Yesterday I have removed that project (BreadcrumbLib) from my solution and the main project worked fine.
Today it doesn't work.

What can I do about this?
What piece of forsaken information makes Visual Studio or whatever program builds the .g.cs files put that reference there?

like image 462
Vercas Avatar asked Jul 27 '11 14:07

Vercas


People also ask

What is G cs files?

The g. cs file is a partial class created by a single-file generator when the . xaml file is saved. It basically contains code declarations for the named elements in the xaml.

What is Cshtml G cs?

g. cshtml. cs , that usually means, that there is a directive directly in the view ( . cshtml or . vbhtml ), that the compiler cannot resolve.

What is a designer cs file?

The designer file (. Designer. cs) is a code file automatically generated by your designer to hold the form's layout information that was created using the Visual Studio IDE. Once you add a new form in your application, VS will automatically generate the designer file for this form.


1 Answers

Try doing a clean. If that doesn't work, delete the bin obj directories in your solution, then do a full rebuild. Make sure none of your XAML files are referencing that component (which is what's generating the .g.cs file).

like image 194
Jeff Avatar answered Oct 21 '22 21:10

Jeff