Disk Cleanup Utility should delete temporary .Net files.

 

I noticed that one of our servers with low disk space had a lot of  security.config.cch files(or security.config.cch.number) in individual user folders, as well as in .Net.Framework config directories.
According to the thread 
http://www.pcreview.co.uk/forums/thread-1228604.php -it seems they are safe to delete.
But why they are located in config folder, not in some temporary directory, like
NET\Framework\{version}\Temporary ASP.NET Files folders?


And they should be suggested for deletion by standard MS windows Disk cleanup utility.
I've submitted this suggestion to MS Connect

Links:How to save html file to PDF

I want  to save html file generated by ASP.NET to PDF.
I was pointed to itextsharp open source project.

I found a few links, discussing how to do it:
http://www.velocityreviews.com/forums/t72716-using-itextsharp-to-generate-pdf-from-aspnet.html

 iTextSharp Tutorial Chapter 7: XML and (X)HTML

 iTextSharp Demo(asp.net 2.0):http://rubypdf.com/itextsharp/tutorial01/ap07Chap0707.cs.html introduces HtmlParser.Parse.(see the source code here)

We tried to use it.

HtmlParser.Parse does NOT throw any error , but the pdf file generated from this could be blank/empty.
Debug output shows the messages from parser, if Html file has invalid structure.
This is a big problem: HtmlParser.Parse is very strict and any minor mistakes in HTML causes exceptions or almost silent creation of empty PDF file.

The post of Creating pdf in .NET from html has a lot of interesting comments, including suggestion  to use HTML Agility Pack.

We are going to try how HtmlParser.Parse will be tolerant to html, regenerated from HTML Agility Pack.

The thread   [ 1819614 ] Error parsing images in HTML files has description of the fix

Another option is always use XML complient HTML, verified by http://validator.w3.org/#validate_by_input ,but it could take some time to tidy up the HTML generated from ASP.NET  


 http://www.google.com.au/search?source=ig&hl=en&rlz=&q=HtmlParser.Parse&meta=

 Links to other products:  

Generate PDF from ASP.NET gives a few references to different products including iTextSharp

 Dynamically Generating PDFs in .NET : http://www.developerfusion.co.uk/show/6623/ 

 Another option is to try (and possibly buy) commercial product abcpdf

 

I saw a suggestion to use http://www.htmldoc.org/ -the command line version of HTMLDoc to convert HTML to PDF, but it is not good for programmatic access.

Call Synchronous Web Services Methods Asynchronously

I need to asynchronously call a few web services at the same time.
VS 2005/2008 Web services proxy  generator creates several proxy class methods , including
synchronous MyWebMethod(parameters) and asynchronous pair BeginMyWebMethod(parameters) and EndMyWebMethod(parameters)
The way to use Begin/End methods is described in article "Calling Web Services Asynchronously
 
Even if I am going to use asynchronous method in the real application, for unit testing(including TestHarness ) it is much easier to start with synchronous version. 
Correct population of all  input parameters and reading response can take some time for coding/debugging(if the web service method is not trivial).
Usually this code wrapper implemented as a separate function (e.g. CallMyWebMethod) in your client application.
 
If you want to use asynchronous pair , your will need to duplicate the wrapper functions as BeginCallMyWebMethod , that will filled request data and EndCallMyWebMethod function, to read and interprete response.
 
I found that it is simpler to use ability to call Synchronous Methods Asynchronously (using delegate invoke) directly in your code rater than use pre-generated Begin/End pair.
 
// call the service.

MyClass.ExecuteDelegate requestDelegate =new MyClass.ExecuteDelegate(myRequest.CallMyWebMethod);

MyAsyncState asyncState =new MyAsyncState (myData);

IAsyncResult asyncResult= requestDelegate.BeginInvoke(null, asyncState);

 //and when call will be completed

 AsyncResult asyncResult=(AsyncResult)ar;

MyClass.ExecuteDelegate requestDelegate = (MyClass.ExecuteDelegate)asyncResult.AsyncDelegate;

 MyResponseClass myResponse =(MyResponseClass )requestDelegate.EndInvoke(asyncResult); 

In this case the actual custom  application code of CallMyWebMethod function stays unmodified for both sync and async execution.

Similar approach was described in my old post Asynchronous long-running tasks in ASP.NET application
«July»
SunMonTueWedThuFriSat
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789