.net-4.5

Lost access to HTTP Request after upgrade to .NET Framework 4.5

别等时光非礼了梦想. 提交于 2019-12-11 18:07:18
问题 I have a WCF service that accepts a POST request from jqGrid in the form of HTML form and returns JSON. While things were on .NET 4.0, all worked fine. I could access form fields inside the service via request["fieldName"] . Once I upgraded to .NET 4.5, all my request["fieldName"] are now blank. Is there some kind of known issue with .NET 4.5, WCF and HttpContext.Current.Request ? Here is an example: POST http://{REMOVED}/Grid.svc/Execute HTTP/1.1 Accept: application/json, text/javascript, */

iTextSharp is giving me the error: “PDF header signature not found”

荒凉一梦 提交于 2019-12-11 17:54:02
问题 Everything I have read about this error says the file must be missing a "%PDF-1.4" or something similar at the top; however, my file includes it. I am not an expert in PDF formatting, but I did double check that I don't have multiple %%EOF or trailer tags, so now I'm at a loss as to what is causing my PDF header signature to be bad. Here is a link to the file if you would like to look at it: Poorly formatted PDF Here is what I'm doing. I am getting each page of the PDF in the form of a

scripts at the bottom in mvc 4 - Does not execute <scripts> in View page

巧了我就是萌 提交于 2019-12-11 14:24:21
问题 In MVC4 , Views have script elements included at the bottom of the page. Eg. In _layout.cshtml (under Shared folder), <script> tags are placed at the very bottom. While I understand that this makes the page load faster, the problem is actually this: In my Views , sometimes I happen to use some scripts like autocomplete , something like below: <script type="text\javascript"> ...... </script> which is not functional because scripts tag are included at the very end of the page. (JQuery is not

How can I use TPL with the new APIs in Azure StorageClient 2.0 and newer?

梦想与她 提交于 2019-12-11 14:09:53
问题 The Azure Storage client was recently updated to version 2.0, and I haven't found any API that returns Task. How can I use TPL with Table Storage? .. Blob or Queue? For your reference the new API has an example here for Table Storage. 回答1: Looking through some of the source under https://github.com/WindowsAzure/azure-sdk-for-net/ it appears that they haven't had a chance to add the Task versions yet (seems odd since it specifically mentions targeting .NET 4), but the operations appear to have

Add as link to within a project folder to copy always to root of output

末鹿安然 提交于 2019-12-11 13:11:35
问题 I'm doing some interop with unmanaged .dll s in a standard c# project. I cannot add these .dll s as simple references and have to use P/Invoke to actually use them. They don't include manifests so doing any clever reflection stuff to load these dynamically (And thus solve the problem of including them as explicit, separate files) is simply out of the question. I am not concerned with installer releases, I can tell WiX(Or whatever installer platform I choose) what files to exactly put where on

Run two async tasks in parallel and collect results in .NET 4.5

风流意气都作罢 提交于 2019-12-11 12:39:33
问题 I've been trying for a while to get something I thought would be simple working with .NET 4.5 I want to fire off two long running tasks at same time and collect the results in in the best C# 4.5 (RTM) way The following works but I don't like it because: I want Sleep to be an async method so it can await other methods It just looks clumsy with Task.Run() I don't think this is even using any new language features at all! Working code: public static void Go() { Console.WriteLine("Starting"); var

CSV change delimiter

跟風遠走 提交于 2019-12-11 12:34:33
问题 i'm reading a CSV file and changing the delimiter from a "," to a "|". However i've noticed in my data (which I have no control over) that in certain cases I have some data that does not want to follow this rule and it contains quoted data with a comma in it. I'm wondering how best to not replace these exceptions? For example: ABSON TE,Wick Lane,"Abson, Pucklechurch",Bristol,Avon,ENGLAND,BS16 9SD,37030,17563,BS0001A1,, Should be changed to: ABSON TE|Wick Lane|"Abson, Pucklechurch"|Bristol

After upgrading to .NET 4.5, event in UserControl with GridView OnRowCommand with Linkbutton doesn't fire

醉酒当歌 提交于 2019-12-11 10:58:56
问题 I have a stable application where one function suddenly stopped working, after upgrading from .NET 4 to .NET 4.5. The error has been isolated to an event not firing and it has been confirmed beyond any doubt (on 2 servers and 3 workstations), that this error only happens after the .NET 4.5 upgrade (and did not happen before). I have the following: An empty aspx that only contains a usercontrol (don't ask) The user control contains a GridView that is loaded with content after a postback. The

Wait for download to complete

夙愿已清 提交于 2019-12-11 09:27:15
问题 I'm trying to create a simple program to download few files. I've tried some ready-made solutions I found on the web but I can't manage to make it work the way I want it to. I'm using this: private void startDownload(string toDownload, string saveLocation) { Thread thread = new Thread(() => { WebClient client = new WebClient(); client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged); client.DownloadFileCompleted += new