Issue with embedded assembly not matching source when debugging in IIS 7.5

I have a problem debugging a web form application that is configured to use IIS for debugging in Windows 7 and Visual Studio 2010. The example just happened when I make changes to the code for the web form, save, and apparently rebuild before starting the application using F5.

The application starts and I get an error message trying to do something in the application. I tell the debugger to break when an exception is thrown, and again try to complete my task, only to report

The source file is different from when the module was created.

where module is C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\9d7b45ca\11a98b19\assembly\dl3\5e6cf0b2\636409d4_dfeecb01\PerfixEMS_Admin.DLL

The physical folder for my test website is set to the source folder of the web application project, so I always assumed that IIS would look in the bin folder for the necessary assemblies and they would be rebuilt as expected. Why is this not happening?

+4
source share
2 answers

Cleaning up the solution usually works for me.

Update

Given the large number of projects (320), I understand why Clean and Build will not work for you. However, you should try at least once to see if something fixes.

If it fixes your problem but does not last, you need to do one of two things.

Clear only one file

Delete the infringing temporary file. You probably won’t be able to do this because VS is working because it may have a lock in the DLL. You may also have to stop IIS. You can use Process Explorer to search for processes that have a lock.

Use custom solution

Its unlikely that you will modify all 320 projects at once. Create your own solution only for the projects you are working on. You can still get through any project that has a DLL and a PDB if you need to.


What to do

Using a custom solution has its problems, because you can no longer use the project link for projects that are not part of your solution. This affects the control of your team. You also need to make sure that the DLL and PDB outside your solution are in a stable place, and you need a way to detect when other projects have changes that concern you.

These problems can be resolved through a thorough process of registering changes and project scripts that copy files and work with team members to figure out how to share changes.

On the other hand, closing VS for every change or run. Cleanliness and assembly also cannot be performed.

+2
source

this may be a workaround, but I just need to figure out if this will work or not, then we can investigate the original case more. but now try the following:

1- publish this site in another folder

2- open the recently published version from your preferred browser (for example: http: // localhost / APP_NAME ).

3- from VS, open the "Debug" menu, select "Attach to the process ..."

4- select the IIS workflow β€œw3wp.exe” and click β€œAttach”.

(if you cannot find it, make sure the checkbox "show processes in all sessions" is checked)

5- start debugging the source code and let me know what happened, thanks.

+1
source

Source: https://habr.com/ru/post/1346071/


All Articles