Issue My History: I need to sign all my Xml’s before uploading to the government agency. To sign, I’m using client certificates loaded from the X509Store: var repo = new X509Store(“My”, StoreLocation.CurrentUser); repo.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly); foreach (X509Certificate2 certCurrent in repo.Certificates)
Continue readingTag: .net-4.0
[SOLVED] Should methods that return Task throw exceptions?
Issue The methods that return Task have two options for reporting an error: throwing exception right away returning the task that will finish with the exception Should the caller expect both types of error reporting or is there some standard/agreement
Continue reading[SOLVED] Publish is not transforming web.config?
Issue I made a web.config (full file, it doesn’t show XML errors) <?xml version=”1.0″?> <configuration xmlns=”http://schemas.microsoft.com/.NetConfiguration/v2.0″> <configSections> … <location path=”.” inheritInChildApplications=”false”> <connectionStrings> <add name=”ElmahLog” connectionString=”data source=~/App_Data/Error.db” /> <add name=”database” connectionString=”w” providerName=”System.Data.EntityClient”/> </connectionStrings> </location> … with a transform file (web.Staging.config) <?xml
Continue reading[SOLVED] Getting cell-backgroundcolor in Excel with Open XML 2.0
Issue I am trying to get the backgroundcolor of a cell in a excel-spreadsheet. I am using Open XML 2.0 SDK and I am able to open the *.xlsx-file and to get cell-values for example. My code for getting the
Continue reading[SOLVED] Thread.Sleep vs Task.Delay?
Issue I know that Thread.Sleep blocks a thread. But does Task.Delay also block? Or is it just like Timer which uses one thread for all callbacks (when not overlapping)? (this question doesn’t cover the differences) Solution The documentation on MSDN
Continue reading[SOLVED] When should TaskCompletionSource<T> be used?
Issue AFAIK, all it knows is that at some point, its SetResult or SetException method is being called to complete the Task<T> exposed through its Task property. In other words, it acts as the producer for a Task<TResult> and its
Continue reading[SOLVED] Read Big TXT File, Out of Memory Exception
Issue I want to read big TXT file size is 500 MB, First I use var file = new StreamReader(_filePath).ReadToEnd(); var lines = file.Split(new[] { ‘\n’ }); but it throw out of memory Exception then I tried to read line
Continue reading[SOLVED] IIS 8.0 Detailed 500.0 Internal Server Error – IsapiModule Not Found
Issue I am working on a project that was originally built on a previous version on Visual Studio (pre-2013) and I am running into an error. I have searched and searched on google and stackoverflow including these resources: IIS 7.5
Continue reading[SOLVED] How do I clear a System.Runtime.Caching.MemoryCache
Issue I use a System.Runtime.Caching.MemoryCache to hold items which never expire. However, at times I need the ability to clear the entire cache. How do I do that? I asked a similar question here concerning whether I could enumerate the
Continue reading[SOLVED] How to abort a Task like aborting a Thread (Thread.Abort method)?
Issue We could abort a Thread like this: Thread thread = new Thread(SomeMethod); . . . thread.Abort(); But can I abort a Task (in .Net 4.0) in the same way not by cancellation mechanism. I want to kill the Task
Continue reading