视觉工作室调试的突然问题,在团结中工作

发布于 2025-01-23 04:28:14 字数 1472 浏览 0 评论 0 原文

我正在从事团结项目工作了几个月。最后几天,我的Visual Studio客户端出现了一个问题,没有意识到如何。

在调试工具栏上,没有“连接到Unity”按钮可以开始调试项目,但是现在按钮为“启动”。如果我尝试按下它,我会收到以下错误,还显示了屏幕截图中:

一个具有输出类型类库的项目无法直接启动。为了调试此项目,请在此解决方案中添加一个可执行项目,该项目引用了库项目。将可执行项目设置为启动项目。

为了调试该项目,可以直接启动具有类型的 在这里发现了这个问题,该问题说明了如何解决该错误,但是在我的情况下,它行不通:

在该线程中,建议有两个修复程序。 修复a)我要调试的组件已经被设置为“ Statup项目”,并且 修复b)右键单击汇编即时操作并转到属性,我会收到以下错误: “在此处输入图像说明”

更具体地针对我的情况,当我以Unity和Visual Studio启动打开.cs文件时,我现在获取此错误: “在此处输入图像描述”

这表明我的Unity设置不是为Visual Studio作为外部工具的设置,这是错误的,因为我已经配置了很久以前的任何更改,因为然后进行这些设置。实际上,去那里进行双检查视觉工作室的确是使用的外部工具。

由于最后一个错误,必须发生问题。

我想的是,由于我最近更新了,因此外部工具可能仍在引用以前的版本,但是由于VS文件目录是一团糟,所以我无法弄清楚是否是这种情况对于不同的版本,或者是其他引起此问题的东西。

自从我在黑暗中,任何帮助都会大大加以实现!

I am working on a project in Unity for a couple of months now. The last couple of days an issue appeared with my Visual Studio client, without realising how.

On the debugging toolbar, there is no "Attach to Unity" button to start debugging the project, but instead the button now says "Start". If i try to press it i get the following error, also shown in the screenshot:

A project with an Output Type of Class Library cannot be started directly. In order to debug this project, add an executable project to this solution which referances the library project. Set the executable project as the startup project.

Error: A project with an Output Type of Class Library cannot be started directly. In order to debug this project, add an executable project to this solution which referances the library project. Set the executable project as the startup project

I have found out this question here that explains how to fix that error, but in my case it does not work:
A project with an Output Type of Class Library cannot be started directly

In that thread there are two fixes suggested.
Fix a) the assembly i want to debug is already set as the "Statup Project", and
Fix b) right clicking on the assembly i m working on and going to properties i get the following error: enter image description here

More specific for my case, when i open my .cs files in Unity and Visual Studio launches, i now get this error: enter image description here

This suggests that my Unity settings are not set for Visual Studio as an external tool, which is false, since i have configured that a long time ago and have never made any changes since then to those settings. In fact going there to double check Visual Studio is indeed set as the external tool to use.

enter image description here

The problem must be occuring because of that last error, cause when i launch VS momentarily i can see the "Attach to Unity" button, the error pops up and the button changes to "Start" after that.

What i m thinking is that since i have updated VS lately, the external tools might be referancing still the previous version, but since the VS file directory is a mess i cant figure out if that is the case, and i do have seperate .exe files for the different versions or if it is something else that causes this issue.

Any help will be much appriciated since i m in the dark here!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

不弃不离 2025-01-30 04:28:14

好的,所以在用户Ruzihm的评论中,我设法解决了问题,这使我想到了Visual Studio版本与Visual Studio编辑器版本。

这确实与Visual Studio编辑器版本有关。在读取该线程以配置vs vs for Unity之后: https://learn.microsoft.com/en-us/visalstudio/gamedio/gamedio/gamedev/gamedev/gast--------------------- Studio-tools-for-for-for-for-pivots = Windows

我发现Unity的软件包管理器中的Visual Studio编辑器软件包有了新的更新,如屏幕截图中所示:

sstatic.net/2Hzt3.png“ rel =“ nofollow noreferrer 新版本一切都恢复了正常,我可以再次开始调试!

这是非常奇怪的cuase在统计上对此颗粒包的警告,因此您知道有一个新的更新,但是这次我没有这样做,而当我想解决该错误时,我没有考虑过。

Ok so i managed to solve the issue myself after the comment of user Ruzihm in my question that got me thinking about Visual Studio versions VS Visual Studio Editor versions.

It was indeed a problem that had to do with Visual Studio Editor version. After going to read this thread for configuring VS for Unity: https://learn.microsoft.com/en-us/visualstudio/gamedev/unity/get-started/getting-started-with-visual-studio-tools-for-unity?pivots=windows

I found out that there was a new update to Visual Studio Editor package in Unity's Package Manager as shown in the screenshot: enter image description here

After updating to the new version everything went back to normal and i can start debugging again!!

It is very weird cuase ussually Unity threw a warning about this particural package on stratup so you know there is a new update, but it didnt do that in my case this time and i didnt think about it when looking to fix that error.

甜妞爱困 2025-01-30 04:28:14

我查找了以前的答案:您已将编译的项目下载到DLL组件中,并提供了一组具有实现功能的类。

您应该在解决方案中添加一个新的项目,其中具有输出类型的控制台应用程序或Windows应用程序(VS Add Project向导将为您提供不同的项目模板)。

在新添加的项目中,您可以实现逻辑来测试类库。

您可以通过以下步骤找到和更改项目的输出类型:

右键单击解决方案资源管理器中的项目 - >特性。

在带有属性的打开选项卡中,选择应用程序,并将在输出类型标签上标记Combobox。
当使用VS工具开发时,我希望它会为您提供帮助。谢谢这是链接:“一个项目,具有输出类型的项目不能直接启动班级库”

I looked for the previous answer: The project you have downloaded compiles into a dll assembly and provide a set of classes with implemented functionality.

You should add to your solution a new project with Output Type of either Console Application or Windows Application (VS Add Project wizard will offer you different templates of Projects).

In the newly added project, you can implement logic to test your Class Library.

Output type of the project you can find and change by the following steps:

Right click on project in Solution Explorer -> Properties.

In opened tab with properties select Application and there will be ComboBox marked with Output Type label.
This problem occurs when developing with vs tools, I hope it will help you. Thank you this is the link: "A project with an Output type of Class Library cannot be started directly" library-cannot-be-started-directly

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文