ywuwgij / elmah

Automatically exported from code.google.com/p/elmah
Apache License 2.0
0 stars 0 forks source link

Slow save of Markup Files with Elmah 1.2 as reference #237

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Saving markup with Dev Express controls causes elmah to look for data provider 
dlls. Most of the files are not found, which leads to severe performance issues 
when trying to save the file. Some pages with only 45 lines of markup take 
30-45 seconds to save on a beefy machine.

I don't know why Dev Express controls are causing Elmah to search for these 
dlls. I have started a ticket with them too. However using ProcMon.exe we see 
that the system is looking for theses files in several locations. These are 
some of the files that it seems to be trying to find.

npgsql.dll
system.data.sqlite.dll
mysql.data.dll

What steps will reproduce the problem?
1. Use Nuget to install Elmah 1.2
2. Create a new master page or aspx page with several Dev Express grids or 
ASPxRoundPanel controls. 
3. Notice that saving the file is very slow and VS is unresponsive during the 
save.
4. Remove the Elmah.dll reference from the project.
5. Notice that the saving of the same file is almost immediate. 
6. You will have to bin deploy elmah.dll to run your project since the dll is 
no longer a reference that is copied to the bin directory. 

What is the expected output? What do you see instead?
Elmah should not be searching for files during a save at design time. 

What version of the product are you using? On what operating system?
Elmah 1.2 on Windows 7, Visual Studio Ultimate and Professional with and 
without SP1 exhibit this problem.  I have not tested with Elmah 1.1. 

Please provide any additional information below.

Original issue reported on code.google.com by justints...@gmail.com on 11 Jul 2011 at 5:03

GoogleCodeExporter commented 9 years ago
Updated the attached project to remove the StyleCop dependency for people that 
don't have StyleCop installed.

Original comment by justints...@gmail.com on 11 Jul 2011 at 5:08

Attachments:

GoogleCodeExporter commented 9 years ago
If I download the install the drivers for MySQL, PostgreSQL and SQLite and put 
them in the bin folder of the project, then the problem does not happen. 
However, I am using SqlCE as the backing store so I don't know why Elmah is 
searching for these drivers at design time.

Original comment by justints...@gmail.com on 11 Jul 2011 at 5:36

GoogleCodeExporter commented 9 years ago
Hi there!

This is not an ELMAH issue, but rather one with DevExpress.
ELMAH references the DLLs you refer to for specific implementations of the 
backing store. These references are only ever loaded at run-time on demand. 
i.e. if you aren't using MySql, you don't require the MySql DLLs in the bin 
folder/GAC in order to run ELMAH.

DevExpress must be doing something behind the scenes to scan all DLLs in the 
bin folder along with ANY dependencies they have, regardless of whether or not 
they are there or being used.

Sorry - there's nothing we can do except say to push them hard on the ticket 
you've raised.

In the meantime, your workaround would be to keep the extra DLLs in your bin 
folder and simply not deploy them to test/prod

Hope this helps!

Cheers,

James

Original comment by jamesdriscoll71 on 12 Jul 2011 at 10:48

GoogleCodeExporter commented 9 years ago
Thank you for the prompt response. I really had a feeling that this issue was 
due to Dev Express. However, I just wanted to cover my bases and let both 
parties know what was going on. It has been very frustrating to have this 
problem, since it took about too weeks to diagnose the problem. That is a long 
time for your markup pages to take 30 seconds to 5 minutes to save ;). 
Hopefully this will show up in search results for others since my DX support 
ticket was the only meaningful hit for me when trying to figure this out. 

Again, thanks for the response and I will let them know.

Original comment by justints...@gmail.com on 12 Jul 2011 at 12:41

GoogleCodeExporter commented 9 years ago
Just in case anyone else has the problem, we found what is triggering this 
activity. 

We moved the <%@ Register %> tags for DX controls from each ASPX markup page to 
the web.config like this:

<system.web>
   <pages>
      <controls>
         <add tagPrefix="dx" namespace="DevExpress.Web.ASPxGridView"
          assembly="DevExpress.Web.ASPxGridView.v11.1, Version=11.1.5.0, 
          Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
     </controls>
   </pages>
</system.web>

Apparently, when you save the markup page that has a <dx:CONTRLNAME /> tag, 
Visual Studio tries to scan all project references for any possible referenced 
files. I guess this is what is triggering it to find any DLL that ELMAH.dll 
could possible need. Since our system does not have the MySql, PostgreSQL, or 
SQLite dlls installed, it has to time out before going on to the next dll to 
scan.

For now you can solve this by 2 methods:

1. Remove the Elmah as a project dll and create a post-build script to copy 
elmah.dll to the bin directory.
2. Put the <%@ Register /> tags for DX control back into each individual page 
and remove them from the web.config

Hope this helps anyone else with this problem. 

Original comment by justints...@gmail.com on 15 Jul 2011 at 2:28

GoogleCodeExporter commented 9 years ago
I created a ticket with Microsoft if anyone is interested.
http://social.msdn.microsoft.com/Forums/en-US/vseditor/thread/baa4eac3-2ac6-440f
-ab3b-3bf3f4d90a29

Original comment by justints...@gmail.com on 15 Jul 2011 at 3:05

GoogleCodeExporter commented 9 years ago
Thanks for all the info - very useful!!

Original comment by jamesdriscoll71 on 15 Jul 2011 at 3:42

GoogleCodeExporter commented 9 years ago
I realize this is the Elmah thread, but if DevXpress users happen upon this 
post because of the same problem, I may have a solution. The order of the 
controls in the web.config can influence the save time in the editor. I moved 
the ASPxGridView and ASPxEditors controls to the top of the <controls> section 
in the web.config. My save time on one page went from 18 seconds to about 1 
second.

Hope this helps.

Original comment by Smith.Er...@gmail.com on 28 Aug 2013 at 3:55