diff --git a/docs/errata/README.md b/docs/errata/README.md index 0128c4d..0196cdd 100644 --- a/docs/errata/README.md +++ b/docs/errata/README.md @@ -6,6 +6,6 @@ If you find any mistakes in the seventh edition, *C# 11 and .NET 7 - Modern Cros [**Improvements** (35 items)](improvements.md): Changes to text or code that would improve the content. These are optional. -[**Common Errors** (4 items)](common-errors.md): These are some of the most common errors that a reader might encounter when trying to get code in book tasks to work, or when trying to write your own code. +[**Common Errors** (5 items)](common-errors.md): These are some of the most common errors that a reader might encounter when trying to get code in book tasks to work, or when trying to write your own code. All errata and improvements will be included in the 8th edition planned for publishing in November 2023. To be included they must be submitted by mid-September 2023. diff --git a/docs/errata/common-errors.md b/docs/errata/common-errors.md index 03fdb59..1cc38e2 100644 --- a/docs/errata/common-errors.md +++ b/docs/errata/common-errors.md @@ -1,7 +1,8 @@ -**Common Errors and How to Fix Them** (4 items) +**Common Errors and How to Fix Them** (5 items) If you have suggestions for other common errors, then please [raise an issue in this repository](https://github.com/markjprice/cs12dotnet8/issues) or email me at markjprice (at) gmail.com. +- [MSB3026/MSB3027 Cannot rebuild/compile a project](#msb3026msb3027-cannot-rebuildcompile-a-project) - [Missing types and members in a utility class](#missing-types-and-members-in-a-utility-class) - [CS0103 The name 'DoSomething' does not exist in the current context](#cs0103-the-name-dosomething-does-not-exist-in-the-current-context) - [CS0122 'Util.DoSomething()' is inaccessible due to its protection level](#cs0122-utildosomething-is-inaccessible-due-to-its-protection-level) @@ -10,6 +11,26 @@ If you have suggestions for other common errors, then please [raise an issue in - [Microsoft introduces a bug in a later version](#microsoft-introduces-a-bug-in-a-later-version) - [Service not started when you try to call it](#service-not-started-when-you-try-to-call-it) +# MSB3026/MSB3027 Cannot rebuild/compile a project + +While actively working on a project, you often run an app, it "crashes", you make a code change, recompile, and run it again. Sometimes recompiling will fail with the following warning: +``` +Warning MSB3026 Could not copy "C:\cs11dotnet7\Chapter02\Ch02Ex03Numbers\obj\Debug\net7.0\apphost.exe" to "bin\Debug\net7.0\Ch02Ex03Numbers.exe". Beginning retry 1 in 1000ms. The process cannot access the file 'bin\Debug\net7.0\Ch02Ex03Numbers.exe' because it is being used by another process. The file is locked by: "Ch02Ex03Numbers (9728)" +``` + +By default, the warning repeats ten times and then you will see the following error: +``` +Error MSB3027 Could not copy "C:\cs11dotnet7\Chapter02\Ch02Ex03Numbers\obj\Debug\net7.0\apphost.exe" to "bin\Debug\net7.0\Ch02Ex03Numbers.exe". Exceeded retry count of 10. Failed. The file is locked by: "Ch02Ex03Numbers (9728)" +``` + +These messages tell you that you are still running the old console app process so that the build process cannot copy the new version over the old version. + +To solve this problem, close the running console app. + +If you cannot find the console app to close it, then it might still be running but not visible in the operating system. + +To solve this problem, reboot your computer. + # Missing types and members in a utility class ## CS0103 The name 'DoSomething' does not exist in the current context