"Type not defined" error when building a project

I created a new Windows VB.net application project and added a link to my utilities project, as I did many times before. When I start coding, the editor will find the utility namespace easily, but when I create it, I get "My.Utils.Data type is not defined".

I compared my project with other projects and can not find the difference.

When I try to debug, I get a dialog saying: "Visual Studio cannot start debugging because there is no debugging target" C: ..... \ myproject.exe "

+6
source share
2 answers

You need to make sure that the consumption project targets a version of the .NET Framework that is equal to or greater than the other project to which it refers. If the referenced project is aimed at a higher version of the framework, Visual Studio will not give you a useful message such as "Invalid version of the Framework." Instead, it gives you a very confusing error that the assembly is missing, even if it is.

+16
source

I ran into this error and had a more unusual reason. I will add this here because someone might experience the same thing. (I do not expect this to be the “normal” cause of this error.) In any case, I created a link to the service, and I removed the text “Link” from its name and named it “ServiceName”, not “ServiceNameReference”. Apparently, this created a name conflict that exploded the reference.vb file.

0
source

Source: https://habr.com/ru/post/951813/


All Articles