.net-4.0

Visual Studio 2010 not recognizing .NET Framework 4.0

坚强是说给别人听的谎言 提交于 2019-12-06 10:06:44
I've recently had to uninstall/re-install my .NET Framework 4 after finding my current installation was corrupt. I found this when attempting to upgrade my Telerik Controls. I manually uninstalled my .NET Framework using the command line and then re-installed the newest version of the framework from MSDN. Now when I open previous projects in VS2010 (which are coded in .NET 4), it prompts me to Install .NET Framework 4.0 or retarget the Project to a another Framework or Profile. Is there a way to refresh Visual Studio 2010 to recognize that I have the .NET Framework installed? and/or would a

wpf datagrid bug? when toggle visibility on a column with an image as headercontent

China☆狼群 提交于 2019-12-06 09:38:57
问题 i have the following problem. if i use an image for a datagrid header i get an error while toggling visibility. <DataGridTextColumn Header="{StaticResource Image_Link}" IsReadOnly="True"> Error: Bei dem angegebenen Element handelt es sich bereits um das logische untergeordnete Element eines anderen Elements. the only workaround i found so far is to create a ControlTemplate with the specific image foreach of my imageheadercolumns. is this datagrid behaviour a bug? EDIT: Error translated by

How to access GUI of a Windows application run by task scheduler under a specific domain user?

耗尽温柔 提交于 2019-12-06 09:21:39
On our server running Windows Server 2008 R2 there is a scheduled task that runs a Windows application (.Net 4.0) under a specific domain user that performs some tasks and reports its progress in a listbox on a form that pops up by double clicking on a tray icon (right hand side of the task bar). I understand that if I logon to the server (I can only remote desktop to the server) with a different user other than the one the scheduled task runs the application under I would not be able to see any user interface of the application but the problem is even if I remote desktop with the same login

Deploying Office 2010 addin

回眸只為那壹抹淺笑 提交于 2019-12-06 09:10:15
I've created two addins, one is shared addin (for Excel, Word and Outlook) and another one is for Outlook. They work fine on my machine (where I developed it). Framework used: 4.0 I've created a 'setup project' throught VS2010 following steps in Deploying an Office Solution by Using Windows Installer . When I run setup of it, shared addin runs fine. But the outlook addin does not work. This is log of 'Event Viewer' Event Type: Error Event Source: VSTO 4.0 Event Category: None Event ID: 4096 Date: 4/26/2011 Time: 7:37:52 PM User: N/A Computer: XXX Description: Customization URI: file:///C:

XmlSerializer vs DataContractSerializer

China☆狼群 提交于 2019-12-06 08:52:48
问题 I just realized that DataContractSerializer expects nodes in the alphabetical order or the specified order. Is there any way i could make it NOT do it? TIA 回答1: I don't think so. You may find the discussion on this question informative: Ignore field order in DataContractSerializer 回答2: I used IDispatchMessageInspector.AfterReceiveRequest to intercept the message and sort it alphabetically. 来源: https://stackoverflow.com/questions/3570729/xmlserializer-vs-datacontractserializer

Add winlogon login method using C# and YubiKey

偶尔善良 提交于 2019-12-06 08:37:30
As for personal fun and challenge, I wanted to add a way to login on my own personal computers. All are currently using Windows 7. Normally this would use ICredentialProvider or something like that. Basically the goal here is to have 2 way to login, the normal user/password one and the alternative (mine) with a Yubikey. Is there any where I could look to find some resources on how to achieve this using C# ? There is an article about implementing a custom Credential Provider here , and there is some samples here . However, I do believe you need to implement a custom Credential Provider in

How to connect to a running instance of outlook from C# [duplicate]

筅森魡賤 提交于 2019-12-06 08:09:39
问题 This question already has answers here : Getting/Creating an Outlook Application in Windows 7 (5 answers) Closed 6 years ago . In VBA, I usually use appOutlook = GetObject(, "Outlook.Application") to get a running instance of Outlook, and it throws an error if Outlook isn't running. I normally did this in excel, but now I am wanting to see if I can get better results by moving to C# and doing it from there. What I need to do is copy emails from outlook and paste them into excel so that the

Memory size of a list of int

核能气质少年 提交于 2019-12-06 08:04:11
I have a list of int that's stored in the DB in the form of a string with commas in between (4345,324,24,2424,64567,33...). This string could become quite large and contain 2-3 thousand numbers. It's stored in the DB and used quite frequently. I'm thinking that instead of reading it from the DB every time it's needed, it'd be better to store it in the session after it's loaded the first time. How much memory would a list of 1,000 int require? Does the memory size also depend on the int itself such that storing a larger int (234,332) takes more space than a smaller int (544)? Is it going to be

Application.GetContentStream returns null for content Uri

China☆狼群 提交于 2019-12-06 07:56:54
I have file "sample.xml" in my project set as content. I am running this code: Uri uri = new Uri("/sample.xml", UriKind.Relative); StreamResourceInfo contentStream = Application.GetContentStream(uri); Why it returns null contentStream? It means probably that it does not find the file. Is the path correct?. Return Value Type: System.Windows.Resources.StreamResourceInfo A StreamResourceInfo that contains a content data file that is located at the specified Uri. If a loose resource is not found, null is returned. You must set file's Build Action as Content, and Copy To Output Directory to Copy

.NET Dynamic method. Best performance

北战南征 提交于 2019-12-06 07:51:25
问题 What is the best way to create dynamic method on a fly but have it same efficient if it was compiled in VS? Say I want create a calculator. User inputs formula say A + B / C * 0.5; What I want is to be able to create something like Func which will accept A,B,C as double parameters and return double. The parameters type and the return type are always double. Number of parameters are variable but at least one. These formulas can be changed / added often. Once a formula 'compiled' it will be