视觉工作室。代码更改没有任何作用

发布于 2024-11-08 14:33:32 字数 140 浏览 3 评论 0原文

我对代码所做的任何更改都没有任何作用。我什至尝试过添加一些我知道会使我的程序崩溃的行,但什么也没有。它只是继续运行旧版本。它甚至加载我编辑和保存的文件的旧版本。

我的解决方案中有 3 个项目。 2 是纯 C#。 1 是一个WinForms 应用程序。

Any changes I make to my code aren't doing anything. I've even tried putting lines in that I know will crash my program, and nothing. It just keep running the old version. It's even loading old versions of files I've edited and saved.

There a 3 projects in my solution. 2 are pure C#. 1 is a WinForms application.

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

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

发布评论

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

评论(14

ゞ花落谁相伴 2024-11-15 14:33:32

有时会发生某些文件“正在被另一个进程使用”的情况。

关闭解决方案并删除解决方案中包含的所有项目的所有“bin”和“obj”子文件夹。

然后再次打开您的解决方案,执行“清理解决方案”并再次构建它。

It sometimes happens that some files "are being used by another process".

Close your solution and delete all "bin" and "obj" subfolders of all your projects that are included in the solution.

Then open your solution again, execute "Clean solution" and build it again.

安稳善良 2024-11-15 14:33:32

在“工具/选项”中检查此设置,然后在“项目和解决方案”>“构建并运行”下检查。

运行时,当发生构建或部署错误时:

我个人偏好将此值设置为“不启动”。它将阻止 Visual Studio 启动“上次成功的构建”。

Check this setting in Tools/Options, then under Projects and Solutions>Build and Run.

On Run, when build or deployment errors occur:

My personal preference is for this value to be 'Do not launch'. It will prevent Visual Studio from launching the "last successful build".

抽个烟儿 2024-11-15 14:33:32

尝试 Ctrl+Shift+B。这将构建您的解决方案(不仅仅是一个特定的项目)。保存时可能会构建其他环境,但这需要在 Visual Studio 中明确显示。

Try Ctrl+Shift+B. This will build your solution (not just a particular project). Other environments might build when you save but this needs to be explicit in Visual Studio.

等待我真够勒 2024-11-15 14:33:32

在 VS2017 (mac) Version 7.3 Preview (7.3 build 740) 上保存代码更改时出现问题,

保存文件更改的唯一方法是执行 File >保存全部

执行“文件”>“保存”就像保存文件一样。但是,当我再次打开该文件时,没有保存任何更改。

Had issue with saving code changes on VS2017 (mac) Version 7.3 Preview (7.3 build 740)

Only way to get file changes to save was to do File > Save All

Doing File>Save would act like the file saved. But, when I opened the file again and no changes were saved.

薔薇婲 2024-11-15 14:33:32

好的,您需要添加更多详细信息,但您可能想看看这个答案:

如何在 Visual Studio 中启用/禁用编译错误警告

Ok, you need to add more detail, but you may want to have a look at this answer:

How to enable/disable compile errors warning in Visual Studio

獨角戲 2024-11-15 14:33:32

中删除已发布的 DLL

从 Bin文件名

projectName.ddl
projectName.pdb

-删除这两个文件并运行项目

delete Published DLL From Bin

file names -

projectName.ddl
projectName.pdb

delete these two files and run project

请你别敷衍 2024-11-15 14:33:32

我遇到了同样的问题(Visual studio 2015 没有注意到我在 C# XAML 文件中的修改)。

通过删除 2 个“调试”子文件夹解决了问题。一份在 bin 文件夹中,一份在 obj 文件夹中。

I had the same problem (Visual studio 2015 is not noticing my modifications in C# XAML files).

Problem solved by deleting 2 'debug' subfolders. One in the bin folder and one in the obj folder.

吹梦到西洲 2024-11-15 14:33:32

我遇到了同样的问题。代码更改未保存。(您可以从编辑中看到它是黄色的。例如表示更改)。 SAVE 和 BUILD 不会让它保存更改。我必须等待一段时间,然后它可能会挽救成功..

I met the same problem. the code changes is not saved.(you can see from the edit it is in Yellow color. e.g. indicating changes). SAVE and BUILD will not let it save the changes. i have to wait sometime, then it could possibly save success..

眼眸 2024-11-15 14:33:32

从本地删除整个项目和相应的文件夹,然后再次查看解决方案。这对我有用=> VS2017

Deleting the whole project and the corresponding folder from local and check out the solution again. This worked for me=> VS2017

花开雨落又逢春i 2024-11-15 14:33:32

我这样解决了这个问题:

1.我关闭了程序

2. 我打开了包含该文件 (.csproj) 的文件夹,并使用 Visual Studio 将其打开。

接下来,我选择了运行命令的文件夹,如图所示

vs header

I solved the problem like this:

1. I closed the program

2. I opened the folder that contains the file (.csproj) and opened it with Visual Studio.

Next, I chose the folder to run the command as in the image

vs header

真心难拥有 2024-11-15 14:33:32

有同样的问题。原来我移动了一个项目文件夹。即使从移动的文件夹中打开解决方案并编辑和保存此源代码,VS 2019 也会构建并运行具有相同名称的程序的不同实例。转到文件->将 yourproject.cs 保存为..并手动返回目录结构以查找 VS 实际运行的实例。希望这有帮助。

Had the same problem. Turns out I had moved a project folder. Even when opening the solution from the moved folder and editing and saving this source code, VS 2019 was building and running a different instance of the program with the same name. Go to File-> Save yourproject.cs as..and manually walk back through the directory structure to find the instance VS is actually running. Hope this helps.

旧时浪漫 2024-11-15 14:33:32

还要检查“工具”>“构建和运行”>“仅构建启动项目”中的另一个选项如果您有超过 1 个嵌套依赖项,尤其是在使用 Prism 或任何其他阻止“依赖项检测”的基于反射的框架时。另外,请确保在使用 Ctrl+S(保存)或 Ctrl+ShiftCtrl+Shift 等快捷键时位于编辑器中kbd>+S(全部保存)

also check another option in Tools>Build and Run>Only build startup project & dependencies if you have more than 1 nested dependency, especially when using Prism or any other reflection-based frameworks that prevent "dependency detection". Also, make sure you're in the editor when using shortcuts like Ctrl+S (Save) or Ctrl+Shift+S (Save all)

无所谓啦 2024-11-15 14:33:32

转到此位置:

C:\Users\<your_system>\AppData\Local\Microsoft\VisualStudio\<studio_version>

然后删除所有文件并启动 Visual Studio。

Go to this location:

C:\Users\<your_system>\AppData\Local\Microsoft\VisualStudio\<studio_version>

Then remove all files and start Visual Studio.

橘香 2024-11-15 14:33:32

意外

这是错误,构建后没有进行任何更改。

accidently

this was the error , no changes made after build.

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