File and Line Numbers for Errors Are Not Displaying in the Error List Unless the File Is Open

File and Line Numbers for Errors are not Displaying in the Error List Unless the File Is Open

I had the same issue on projects that are using legacy Workflow framework V3. Interesting to note, that if project has only compiler warnings, the file and line are shown correctly, but error causing all warnings and errors refer to file C:\Windows\Microsoft.NET\Framework\v4.0.30319\Workflow.Targets(121,5):

The nasty workaround that I found is

  1. Unload the project
  2. Comment out at the bottom of the .csproj file the line
<Import Project="$(MSBuildToolsPath)\Workflow.Targets" />

  1. Reload the project and compile it. Compiler errors will be shown with correct file name and line numbers.
  2. Fix compiler errors
  3. Again unload the project, restore Workflow.Targets import and reload the project.

The similar solution was reported to MS https://connect.microsoft.com/VisualStudio/feedback/details/797056/state-machine-workflow-projects-using-vs-2012

If you forget to restore Workflow.Targets import, there will be run-time errors like

System.Workflow.ComponentModel.Compiler.WorkflowValidationFailedException: The workflow failed validation.
at System.Workflow.Runtime.WorkflowDefinitionDispenser.ValidateDefinition(Activity root, Boolean isNewType, ITypeProvider typeProvider)
at System.Workflow.Runtime.WorkflowDefinitionDispenser.LoadRootActivity

Visual studio is still displaying errors for a file that I already deleted

I don't think that's a real error, if you have indeed deleted that file already.

I have a couple of suggestions:

  1. Close Visual Studio
  2. Delete all the temp files from the Temporary folders in Windows/Microsoft.Net/ Framework and Framework64/TemporaryInternetFiles

Open Visual Studio and reload your solution. If you still see errors and that file is still part of your solution.

On my system one of the paths is like this : "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files".

When you compile an application the code gets deployed in one of the 32 or 64 bit folders. This allows the code to run quickly without recompilation if nothing has changed from the previous run. This is usually one of the sources of issues like the one you are seeing. You think you've removed something but old code is still present there in the temp folder.

Can I use the VS2012 Quick Launch to open a file from my solution?

I think the answer is "no" but I found a different way to do the same thing: ctrl-;. This does "search in Solution Explorer". It incrementally searches files and symbols.

enter image description here

Error indicators in file margin in eclipse indigo

Open Preferences, select General/Editors/Text editors/Annotations, and make sure that the errors/warnings are selected to be displayed in the Vertical and Overview rulers.

Delphi XE2 : Off by 7-20 lines in debugger and compiler error line numbers also off by the same amount

I've seen things like this before, and IME it's generally due to an compiler bug in counting line numbers. If you have nonstandard line breaks (not CRLF) at some points--which can happen--the IDE will do proper line breaks but the compiler doesn't count them as new lines, so everything afterwards gets thrown off by one.

What I do when I encounter a file like this is open it in EditPad, convert all linebreaks to some other style (Unix or Mac style) and then convert all linebreaks to Windows style and save it. This ensures that every line in the file ends with CRLF, and after a rebuild the issue with the blue dots not lining up right goes away.



Related Topics



Leave a reply



Submit