Class library project file not compiled into DLL or debugging

in my solution:

  • I have a class library project that compiles in a dll.
  • I have a web project.

(I have several solutions with different web projects, but the same class library)

one of the files in the class project (utilities.cs) - unexpectedly will not compile in .dll

I made changes to this file, but this change will not be displayed on the website. so I set a breakpoint in the .cs file and tried to start it ... the breakpoint didn’t hit! I eventually set a breakpoint in the .aspx file that called the function. then I typed the debugger on one line, so it will go into the .cs file, except that I got an error:

"This source file has changed. It no longer matches the version of the file used to create the debugged application."

therefore the code in utilities.cs is not updated in the dll. which is strange because the code in my other .cs files is being updated (I tried to change a few lines) and I was able to catch the debug version.

any ideas how to fix this? or even the cause of the problem?

+6
c # dll
source share
3 answers

Try:
Right-click Solution in Solution Explorer β†’ Properties β†’ Configuration Properties β†’ Make sure the Assembly check box is checked for your class library.

+6
source share

When you add new links to a web project, you should select the Projects tab:

Projects lists all reusable components created from local projects.

Always rebuild all projects in Release and debug mode .

+2
source share

You need to find out why the DLL will not create:

  • Look at the error output window
  • The Errors window opens

Correct the errors and try to create again.

The DLL you are trying to debug is an older version of your code that compiled OK, and the debugger has selected this and is trying to debug from it - it complains because the code and the dll no longer match.

Try assembling -> Clear Solution, and then rebuild to see errors.

+1
source share

All Articles