.net-4.0

Is there any way to change the Navigation Property name convention when an edmx is generated in Visual Studio 2010 to use the foreign key column name?

六月ゝ 毕业季﹏ 提交于 2019-12-20 02:58:19
问题 I am currently generating some code from an edmx file with a t4 template by going through all of the properties. By default the edmx file has navigation properties that are named after the object type essentially but I would like to change it to work off of the foreign key id column instead. For example there is a Region table which is referred to by a single table twice - it has both a Supervisory Region and a Geographic Region. The default edmx navigation property name is Region and Region1

Built in background-scheduling system in .NET?

点点圈 提交于 2019-12-20 02:34:59
问题 I ask though I doubt there is any such system. Basically I need to schedule tasks to execute at some point in the future (usually no more than a few seconds or possibly minutes from now), and have some way of cancelling that request unless too late. Ie. code that would look like this: var x = Scheduler.Schedule(() => SomethingSomething(), TimeSpan.FromSeconds(5)); ... x.Dispose(); // cancels the request Is there any such system in .NET? Is there anything in TPL that can help me? I need to run

MageUI.exe is not including a compatibleFrameworks element

梦想与她 提交于 2019-12-20 02:31:43
问题 I've got a ClickOnce .NET 4 application deployed by Visual Studio 2010, via a UNC path. I open the .application file, change the startup location to use the HTTP address, sign, and close. The application then gives this error: Application manifest does not accept specification of <compatibleFrameworks>. How do I get MageUI.exe to include this needed element when I sign? This is similar to Stack Overflow question Why does Mage.exe not generate a compatibleFrameworks attribute? . I've tried

Setup program needs framework 4.0 - But it's already installed

纵然是瞬间 提交于 2019-12-20 02:09:23
问题 I created a service which I now want to install to test. When running the setup program it prompts me to download and install .net fw 4.0, but I already have it installed. I did try to just install the file that I get pointed to (4.0 cliet), but not only does it still not work, it causes vs2010 to throw an unknown error and can't open. I've now uninstalled everything and started afresh with VS2010, framework 4.0 and win 7 but it still prompts me to install fw 4.0 when I try to run the setup.

EventSource .net 4.0 GenerateManifest

醉酒当歌 提交于 2019-12-20 01:49:10
问题 I've been trying to work with ETW in .net 4.0. I have started using Microsoft EventSource Library 1.0.4-beta (https://www.nuget.org/packages/Microsoft.Diagnostics.Tracing.EventSource) Here is the code i written for generating events for my application. [EventSource(Name = "Samples-EventSourceDemos-EventSourceLogger")] public sealed class EventSourceLogger : EventSource { public static EventSourceLogger Log = new EventSourceLogger(); public static string GetManifest() { return GenerateManifest

Can I use .NET 4 with SharePoint 2007?

青春壹個敷衍的年華 提交于 2019-12-20 01:41:09
问题 I'm on a team that's currently building a MOSS 2007 based application (which relies on .NET 2), and we'd like to leverage the Entity Framework v4 (which relies on .NET 4). Is this possible? 回答1: No. The 4.0 version of .NET has a new CLR (4.0) etc., but SharePoint 2007 is only supported on CLR 2.0. Even SP2010 does not support .net 4.0 (yet). 回答2: Although I haven't tried, my guess is that it's not possible. In order to use .net 4.0 assemblies, the apppool running your moss site would have to

DataTable throwing exception on RejectChanges

梦想的初衷 提交于 2019-12-20 01:37:50
问题 I found this bug while working with a DataTable. I added a primary key column to a DataTable, than added one row to that table, removed that row, and added row with the same key to the table. This works. When I tried to call RejectChanges() on it, I got ConstraintException saying that value is already present. Here is the example: var dataTable = new DataTable(); var column = new DataColumn("ID", typeof(decimal)); dataTable.Columns.Add(column); dataTable.PrimaryKey = new [] {column }; decimal

.Net 'Any Framework' configuration

扶醉桌前 提交于 2019-12-20 01:36:18
问题 I built a program in C# .NET 2.0 that works great also under framework 3.0 and 3.5. But if .NET Framework 4.0 is the only framework installed, it does not working, it requires the user to install 2.0. i found the following configuration in google: <startup> <requiredRuntime safemode="true" imageVersion="v4.0.30319" version="v4.0.30319"/> </startup> After adding this to the app.config, my program works on .NET Framework 4.0 without any problems! What i searching for is a .NET 'Any Framework'

Use of Socket.BeginAccept/EndAccept for multiple connections

心已入冬 提交于 2019-12-19 22:09:15
问题 Unlike the synchronous Accept , BeginAccept doesn't provide a socket for the newly created connection. EndAccept however does, but it also stops future connections from being accepted; so I concocted the following code to allow multiple 'clients' to connect to my server: serverSocket.BeginAccept(AcceptCallback, serverSocket); AcceptCallback code: void AcceptCallback(IAsyncResult result) { Socket server = (Socket)result.AsyncState; Socket client = server.EndAccept(result); // client socket

Use of Socket.BeginAccept/EndAccept for multiple connections

不羁的心 提交于 2019-12-19 22:09:06
问题 Unlike the synchronous Accept , BeginAccept doesn't provide a socket for the newly created connection. EndAccept however does, but it also stops future connections from being accepted; so I concocted the following code to allow multiple 'clients' to connect to my server: serverSocket.BeginAccept(AcceptCallback, serverSocket); AcceptCallback code: void AcceptCallback(IAsyncResult result) { Socket server = (Socket)result.AsyncState; Socket client = server.EndAccept(result); // client socket