142

I cannot get rid of this in my VS 2008 web project when debugging. I've checked that it's in debug mode on the non-web project in question and it's in Active(Debug). Deleted all items in my .NET 2.0 temp folder in Windows. Not sure what else to do here.

Muntasir
  • 798
  • 1
  • 14
  • 24

34 Answers34

188

Try disabling "Enable Just My Code" in Tools/Options/Debugging/Options.

  • I did that and it worked. I was able to use breakpoints and step through code. I don't get it. Why did it work? (I was debugging a Managed C++ module referenced by a Win Service using VS2010) – tzup May 31 '10 at 10:23
  • 5
    It works but may cause some unwanted side effects when debugging: http://blogs.devsource.com/devlife/content/net_general/vs_debugging_-_why_doesnt_vs_break_on_exceptions.html – user276648 Apr 13 '11 at 11:13
  • 2
    In VS2010 this checkbox is in Debug > Options & Settings, then under Debugging > General – Cookie Jan 02 '12 at 06:53
  • This works due to the rebuilding of the options? What is the deal. I did solve the issue, but why? – Quantum Nov 21 '12 at 16:15
  • Didn't work for me. In my case, doing this will make the error message go away, but then I get the infamous error `The breakpoint will not currently been hit. No symbols have been loaded for this document`. – Vivian River Mar 11 '14 at 21:46
86

I had the same problem and discovered that I wasn't outputting my debug info on my build. If you right click on the project and go to 'properties', then select the 'build' tab, on the bottom of the page there's an 'Advanced...' button that will display your setting for you output debug info. Set that to 'full' and the error should go away.

enter image description here

Jerther
  • 5,558
  • 8
  • 40
  • 59
Geert
  • 520
  • 4
  • 4
  • 1
    This is the correct answer. You should be outputting "full" debug info when you want to debug your application locally in development mode. You should do this rather than the "Enable Just My Code" answer as that answer can have unintended side effects (as noted above). – Tod Thomson Jul 25 '13 at 00:12
  • 1
    @Tod Thomson, I am not sure why you claim this is the correct answer, as I see the message just now while debugging my web application and trying to enter a class library, so very similar to the configuration described in the question. My _Debug Info_ setting is _full_ and I have no reason to believe it has been different ever. – R. Schreurs Aug 01 '13 at 10:47
  • 1
    @R.Schreurs I tried everything else on this page and the only thing that worked for me was this answer. If it doesn't work for you, feel free to try something else here / provide an answer of your own. – Tod Thomson Aug 05 '13 at 02:56
  • It's a Microsoft error. Don't say "should". Unless you're saying "The error should go away but it's Microsoft so you should rethink your life" – user1566694 Oct 07 '15 at 18:16
24

I just ran into this issue, and quickly decided that the other answers posted didn't apply to me.

disable

I'm the owner of the project, and I know it was built with debug information, as well as without optimizations. Furthermore, I'm never happy choosing the disabling of a warning as my first choice. Hiding/ignoring this warning could become an issue in a future debugging session.

Since this only started occurring after I signed the assembly, this clued me in on my quick fix: temporarily remove the strong name of my DLL (and consuming EXE). Voila! Problem solved.

A better, long-term solution, could take the form of adding a post-build action to update the GAC so it has the latest version of the signed DLL.

But for now, I'm happy to move on from this diversion, and continue working on the issue that brought me to this debugging session.

Gustavo Mori
  • 8,319
  • 3
  • 38
  • 52
  • 4
    I was in a similar circumstance to you, but took the easy way out... I uninstalled the program that put this DLL in the GAC, because it was just the older version of what I was debugging. – SeeMoreGain Oct 31 '13 at 01:30
  • 2
    Also +1 for recommending to fix the source of the problem rather than just enable a workaround like all the others suggesting untick "Enable just my code" – SeeMoreGain Oct 31 '13 at 01:32
17

resolved. Deleted all occurences (all projects) of the dll in question.

  • 1
    I closed all VS/VWD sessions where the referenced projects and my active solution were open. Then I deleted EVERY instance of the problem dlls and their companion pdbs. Next, I deleted everything under the temporary debug website location in the .NET framework structure (for this project, it was C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\[myWebsite]). This gave me a 'file in use' error on one of the earlier versions until I closed VWD. Then I reopened the project and fixed every outstanding error and warning in the project's code. Only then did the error go away. – B H Mar 14 '14 at 19:57
14

VS2012, clean and rebuild fixed the issue for me. "Properties" -> "Build" -> Optimize code is unchecked. "Properties" -> "Build" -> "Advanced" -> Debug Info: Full

user2892396
  • 1
  • 1
  • 2
10

Check out this link

http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/43cb16ba-0759-42ab-8e7d-9f168ace3b6f

try unchecking "Just My Code" in Tools->Options->Debugging->General.

it works for me

raksham
  • 157
  • 1
  • 2
  • 9
7

Guessing VS 2008 is not rebuilding the dll correctly.

1) Delete all occurrences of the dll

2) Rebuild solution

And that should fix it.

Nemo
  • 3,285
  • 1
  • 28
  • 22
6

I get this issue as well, for some reason it's happened 3 or 4 times; I think it must be a Visual Studio 2005 bug/hick up (or at least my installation).

This has worked every time: to fix it I

  1. Right click on my solution and click Properties.
  2. Open Configuration Manager.
  3. Select Debug in the drop down menu (if not already selected).
  4. Uncheck BUILD. Then re-check it.
  5. Rebuild the solution.
Dave
  • 8,163
  • 11
  • 67
  • 103
6

If everything else fails, try renaming the Assembly name in the project's properties. This fixed the issue for me.

Sam Neirinck
  • 268
  • 5
  • 11
  • After spending hours and scouring the internet trying everything I came across, this worked. Something must be cached? – Chris R Jul 24 '13 at 20:26
6

Check your build configuration options. Make sure optimizations are turned off and the DEBUG constant is defined.

lc.
  • 113,939
  • 20
  • 158
  • 187
4

Tools > options > Debugging > Symbols > Specify excluded modules look that if the dll or the exe in the excluded modules list

Raymond
  • 71
  • 1
  • 8
3

I was able to resolve this issue by following these steps:

  1. Right-click on the Solution (not the Project), and select 'Properties'
  2. In the left panel, select 'Configuration Properties'
  3. In the right panel, select 'Debug' under the 'Configuration' column for your project

If you do not see the Solution listed in Solution Explorer, follow these steps:

  1. In the menu bar, go to Tools -> Options
  2. In the left panel, select 'Projects and Solutions' (you may need to check 'Show all settings' at the bottom-left area of the window
  3. In the right panel, check 'Always show solution'

I hope this helps.

3

At least for non-web applications this works:

From: http://www.stellarpc.com/articles/board.aspx?id=40

2 - Allow Debugging...

Due to the nature in which one of the assemblies has been built in your application, you will need to change a few settings to allow the code to be handled by the Visual Studio Debugger.

Right click on any project in question from the solution explorer and select 'Properties'. This will open up the project properties panel giving us access to a great many options for our projects. Navigate to the 'Complile' Tab (or 'Build' if your in a C# environment) and select 'Advanced Compile Options...' from the bottom of the screen. This presents us with a prompt that has two key areas of interest:

1) Optimizations - uncheck 'Enable Optimizations'

2) Generate debug info - Ensure that the option is set to 'Full'

uzbones
  • 1,422
  • 11
  • 15
  • Interesting... I have my projects configured this way, and even with this configuration, the message is still appearing. So this is not yet the ultimate solution – Junior Mayhé Jul 13 '11 at 20:24
3

I had this issue with a solution in a certain folder, but if I moved it to another folder or others built it, I didn't get the message. I did the clean, rebuild, and even rebooted and still couldn't get the original to debug without this message. I searched my system for copies of the file causing the error and I found that copies were kept in

c:\User\username\AppData\Local\Assembly\dl3

This was on Win7-64 but will be similar on other Windows OSes. I deleted all of the copies I found there and I no longer get the message. I didn't need to uncheck the "Enable Just My Code".

Also, this was for a WPF app, but I came across this thread in my search so hopefully this will help someone else.

dragonwolf
  • 21
  • 1
2

I had this when trying to remote debug an application on a computer that belongs to a different subnet. I was able to debug and step through the code when running it across the network if the machines were on the same subnet. After changing the subnet though I was unable to step through when running from the network and was getting the "The Following Module was built either with optimizations enabled or without debug information".

The solution? Easy. Copy the built solution across to the machine hosting the remote debugging and run it locally.

dr.blowfin
  • 11
  • 1
2

Had this happen to me on a VS 2010 winForms project. Seeing that the majority of people here have web projects, i think that it has to do with access to the folder in which the project is stored. I say this because when this problem occurred to me Google Drive was synchronizing the folder in which i keep my projects. It seems that just disabling the synchronization does not fix the problem.

My solution is similar to one of the answers above:

  • Went to "Project Properties > Compile > Advanced Compile Options"
  • Checked "Enable optimization"
  • Set "General debug info:" to "None"
  • Unchecked "Define DEBUG constant"
  • And pressed OK
  • Then went back and returned the options to their initial state.

Hope this helps someone as it seems this still happens.

Vlad Macovei
  • 854
  • 1
  • 11
  • 13
2

I too have all these. And I've done all this. It appears this happens to me every time I get a fresh copy of the entire solution out of source control. So if we've done all these, deleted dlls & .pdb files for all references (Assemblies) in the web project, used the clean option on the solution, deleted temp files, closed out VS and reopened, made sure debug mode is selected and set at full and optimations are off, what more is there?!?!?!

PositiveGuy
  • 46,620
  • 110
  • 305
  • 471
2

Follow this : (first STOP debuging)
1:right click on project solution name or project -> Properties
2:under Configuration Properties select configuration Manager
3:Change configuration to debug and click on close
4:Change configuration to debug and click on Apply -> OK
Now rebuild solution....!

Yogesh Gat
  • 21
  • 2
2

I had the same issue on my web project in Visual Studio 2010, and finally I found the reason why I was getting this message. What I did was to change an existing debugging option on Visual studio:

  • Go to Tools->Options->Debugging->Symbols->All modules
  • Check the "unless excluded" radio button
  • Click on the link "Specify excluded modules", then remove the DLL that you want to debug.

In my case it was my web dll file...

1

For me, Checking the "Optimize code" box in the project properties, saving, unchecking it, then resaving did it for me.

Disabling "Enable Just My Code" also worked, but that was more of a work-around than a fix as I didn't want that setting.

adam0101
  • 29,096
  • 21
  • 96
  • 174
1

I have had same problem, but with different cause and solution. The window was the same as that shown by Gustavo (above) but the path was in: "\users\zzz\AppSettings..." (where zzz is windows username)

I had an Excel addin - I was testing the install of the addin, so I had a copy installed through VS install function. VS was obviously trying to debug both the installed copy and the copy I had just launched, and could not find debug symbols on the installed copy.

None of the above solutions worked (without side affects),

SOLUTION: uninstalling the addin, and manually deleting the files in App Settings worked.

SeeMoreGain
  • 1,263
  • 16
  • 36
0

If you are publishing to IIS and not using built in web server -or IIS express- make sure that your publish profile settings is in debug mode. In vs 11 by default it's in release mode.

Ahmed
  • 11,063
  • 16
  • 55
  • 67
0

Just to add, I was looking at this blog to find the solution to the same problem I was facing. Unfortunately the solutions mentioned above didn't help me. At last I figured out, I was installing my bits (along with .pdb) through installer and setting permission explicitly on the installation folder.

Because of which VS was not able to load the pdb even though the file browser was showing the correct file but it was giving the same error mentioned above.

Once I unchecked "Enable Just my code" and removed permission settings from the installer, VS started loading the module.

j0k
  • 22,600
  • 28
  • 79
  • 90
self_noted
  • 119
  • 1
  • 9
0

The one configuration that worked for me was the following

Project --> (Your Project) Properties --> Debug Tab make sure Configuration is set to Active (Debug) Under "Unable Debuggers", make sure "Enable unmanaged code debugging" is checked

tmez
  • 156
  • 1
  • 7
0

I'm creating a Windows Service and here's what worked for me:

  • Uninstall the service.
  • Open a command prompt and go to c:\Windows\Microsoft.NET\Framework64\v4.0.30319
  • installutil C:\MyFantabulusWindowService\bin\Debug\MyFantabulusWindowService.exe

Greatness has been achieved!

0

Case : testing assembly with Console project in SharePoint development - if you're doing SharePoint development and seeing this alert in VS, make sure you deploy your SP assembly to the GAC before testing your console app IF your core SP project has methods you need to call in your console test app.

0

I had this in a repository checkout from SVN where over time the source code of a project was added to the solution.

The solution looked like this

solution
- project 1
  - Reference '..\assemblies\<companyname>.Customers.Adapter1.dll'
- project 2
  - Reference '<companyname>.Customers.Adapter1.dll' (project reference).
- project '<companyname>.Customers.Adapter1'

To solve:

  • In project 1, delete the reference to the assemblies folder dll.

  • In project 1, add a project reference to '.Customers.Adapter1'.

mathijsuitmegen
  • 2,270
  • 1
  • 34
  • 36
0

I had this problem with a project and it turned out commenting out the following line in AssemblyInfo.cs fixed the issue:

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
Mike Cheel
  • 12,626
  • 10
  • 72
  • 101
0

I had the same problem after building with a Release configuration. It turned out that when I switched back to Debug, VS wasn't detecting any differences, so it was not updating the .dll and .pdb files in the bin folder.

Here's what worked for me:

  1. Run iisreset (to clean up the temporary folders)
  2. Save the web.config (to force VS to actually rebuild)
  3. Rebuild on Debug
  4. Start the project
bubbassauro
  • 3,969
  • 2
  • 45
  • 45
  • Why didn't you just use the Rebuild command on the Build Menu? That forces all modules to be rebuilt whether changes are detected or not. – Ron Dec 30 '13 at 20:53
  • @Ron sorry I don't remember all the details this was a while ago, I think there was an issue with that version and rebuilding from the build menu wasn't clearing out the files as expected. – bubbassauro Dec 31 '13 at 04:30
0

Try a rebuild then debug.

tripdubroot
  • 1,143
  • 5
  • 13
0

For me, i deleted all files in temporary asp.net files, and closed my solution and re-open it and it works fine

Ahmad Alaa
  • 767
  • 9
  • 30
0

My case is following: webservice referenced lib1.dll. Later I removed reference as it was no longer used. However lib1.dll remained in the bin folder. Because library was not referenced then Rebuild and Clean actions were not helpful. After manually deleting lib1.dll from bin folder I've get rid of this message.

robsosno
  • 308
  • 1
  • 7
0

I also had this issue, one way to solve this issue is the project from which file is opening in metadata form, add that project as a project reference and not as a file reference such as dll or exe.

user3094279
  • 39
  • 2
  • 10
0

You mentioned it's a web project...do you have

<compilation debug="true />

in your web.config?

Jonas
  • 4,454
  • 3
  • 37
  • 45