.net-4.5

Build platform target AnyCPU EXE still shows 32bit header in 64bit machine

我只是一个虾纸丫 提交于 2019-12-24 02:42:51
问题 Not sure this has been asked before (I could not find any). I have simple console app/ESE and have the below settings. I'm running Windows 8, 63bit OS. And the EXE target framework .NET 4.5 However, when I compile this EXE, it still shows as a 32bit EXE. Since this is "Any CPU", I would expect the EXE to compile as 64bit / PE32+. Can some please help tell why this would be still 32bit? 回答1: You are misinterpreting CorFlags I think. Here is a CorFlags truth table: CPU Architecture PE 32BITREQ

Is it wrong to use routes versus query string parameters? [closed]

自闭症网瘾萝莉.ら 提交于 2019-12-24 01:47:10
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last year . I have a Web API controller with two actions. One action returns a list of all entities from the database. The second action takes a query string parameter and filters the entities. The search action is wired up to use the query string parameter. It works but we encountered an

Calculate coordinates for rotated text plus bounding border

巧了我就是萌 提交于 2019-12-24 01:44:26
问题 I have a form that is going to allow a user to create custom "stamps" to place on a PDF. The form displays with a image of the first page of the pdf and I want the user to basically click on the screen where they want their stamp and be able to preview what its going to look like. Don't worry about any of the PDF stuff, I have that handled. To make things snazzy, I have two copies of the image, the normal one and one with reduced brightness. I display the low brightness image and as the user

Calling REST service with domain credentials from .NET 4.5 HttpClient

筅森魡賤 提交于 2019-12-24 01:44:10
问题 I want to call a REST service that requires domain authentication from .NET 4.5. ( Using Visual Studio 2012 ) Searching Google leads to lots of links of people saying that HttpClient is now the way to do this. However as far as I can tell there is no way to impersonate or attach credentials to HttpClient. In addition, all the popular REST libraries seem to not be compatible with .NET 4.5 yet. Over StackOverflow posts have suggested WebClient as a way around this, although this seems no longer

System.Data.SQLite.DLL no longer loads after switching target framework

只谈情不闲聊 提交于 2019-12-24 00:51:21
问题 I had to switch from .net 4.5 to .net 4.0 because some of my customers still use WinXP. Now, after switching, this is the error I'm getting: Could not load file or assembly 'System.Data.SQLite, Version=1.0.66.0, Culturre-neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. An attempt was made to load a program with an incorrect format. I haven't been able to find a solution for this, but here's what I tried so far: Switch back to 4.5 - Didn't work Add the reference again -

C# CultureInfo.CurrentCulture says en_US but my Windows settings are set to South Africa

▼魔方 西西 提交于 2019-12-24 00:48:29
问题 I changed my Region/Location in my Windows 8.1 control panel to be South Africa. When I start up my app from Visual Studio 2013 and get the CultureInfo.CurrentUICulture it still says "en-US". public CultureInfo getCurrentCulture() { if (CultureInfo.DefaultThreadCurrentUICulture != null) { return CultureInfo.DefaulThreadCurrentUICulture; } else { return CultureInfo.CurrentUICulture; } } I've also tried CultureInfo.CurrentCulture instead of CurrentUICulture, but they are behaving the same way.

How to make HttpWebRequest async

风格不统一 提交于 2019-12-23 19:00:07
问题 I have such code: private async Task<string> Request(url) { Task<string> task = null; try { task = MakeAsyncRequest(url, "text/html"); return await task; } catch { return null; } } private async Task<string> MakeAsyncRequest(string url, string contentType) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.ContentType = contentType; request.Method = WebRequestMethods.Http.Get; request.Timeout = 20000; request.Proxy = null; Task<WebResponse> task = Task.Factory

Waiting for something to happen - asynchronous or synchronous model?

旧巷老猫 提交于 2019-12-23 18:24:21
问题 I have this method WaitForReaderArrival which is like below: (Runs all the time waiting for a reader to arrive) public void WaitForReaderArrival() { do { if (ReaderArrived()) { break; } System.Threading.Thread.Sleep(1000); } while (ReaderArrived() == false); } And I am awaiting for the reader to arrive using, await Task.Run(new Action(WaitForReaderArrival)); if (ReaderArrived()) { //Raise an ReaderArrived here! ..//blah blah } One of my co-worker asked me to change the above line just to

TaskEx.Yield(TaskScheduler)

半腔热情 提交于 2019-12-23 17:20:10
问题 Last month I asked the following question which resulted in my learning of TaskEx.Yield : Can async methods have expensive code before the first 'await'? However, I have since realized that this method actually submits all subsequent code to the ambient TaskScheduler . In true DI spirit, our team has agreed to avoid using ambient instances where possible, so I would like to know if it's possible to explicitly specify a TaskScheduler to use? Something like the following would be great: public

Request.InputStream is empty when service call is made

倾然丶 夕夏残阳落幕 提交于 2019-12-23 15:35:03
问题 I'm working on an ASP.NET 4.5 application and I've encountered a very annoying issue. After migrating to VS2012 we encountered the same issue as here. The given solution worked, however I've now discovered that another issue is occurring. For some reason, the InputStream that contains the body content of the HTTP request is reported to be empty. The Content-Length header claims that there is data present, but I have no way of accessing it. The odd thing is that the data seems to be present in