“类型未定义"项目构建错误 [英] "Type is not defined" error on project build

查看:30
本文介绍了“类型未定义"项目构建错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个新的 VB.net windows 应用程序项目并添加了对我的实用程序项目的引用,就像我以前做过很多次一样.当我开始编码时,编辑器会毫不费力地找到实用程序命名空间,但是当我构建时,我得到未定义 Type My.Utils.Data".

I created a new VB.net windows applications project and added a reference to my utilities project like I have done many times before. When I start coding, the editor will find the utility namespace without difficulty but when I build I get "Type My.Utils.Data is not defined".

我已经将我的项目与其他项目进行了比较,但没有发现差异.

I've compared my project to my other projects and can't find a difference.

当我尝试调试时,我收到一个对话框,提示Visual Studio 无法开始调试,因为调试目标C:.....\myproject.exe"丢失

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

推荐答案

您需要确保使用项目的目标 .NET Framework 版本等于或高于它所引用的其他项目.如果引用的项目针对的是更高版本的框架,Visual Studio 将不会向您提供诸如错误的框架版本"之类的有用消息.相反,它会给你一个关于缺少程序集的非常令人困惑的错误,即使它在那里.

You need to make sure that the consuming project is targeting a .NET Framework version which is equal to or higher than the other project that it is referencing. If the referenced project is targeting a higher version of the framework, Visual Studio will not give you a useful message like, "Wrong Framework Version". Instead, it gives you a very confusing error about the assembly being missing, even though it's there.

这篇关于“类型未定义"项目构建错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆