.net-4.0

Databinding to nested property - Cannot bind property or column (Winforms)

南笙酒味 提交于 2019-12-11 12:39:19
问题 We are running a .NET 4.0 application using Windows Forms. The application uses a single form for two different types of objects. namespace NetIssue { public partial class Form1 : Form { B myObj; public Form1() { InitializeComponent(); myObj = new B(); } private void Form1_Load(object sender, EventArgs e) { textBox1.DataBindings.Add(new Binding("Text", myObj, "c.Message")); } } public class Comment { public int ID { get; set; } public string Message { get; set; } public Comment(string msg) {

Converting a mvc application to .net4

穿精又带淫゛_ 提交于 2019-12-11 12:38:25
问题 I have an MVC web application in asp.net 3.5 How can I convert that to asp.net4? Everywhere I read tells me to use a conversion wizard, well no conversion wizard starts when I open the project in vs. can i manually start the wizard? I am using vs 2010 Thanks 回答1: You could also just Right click the project in Solution Explorer -> Property Pages -> Change the Target Framework 回答2: Check these links http://weblogs.asp.net/leftslipper/archive/2010/07/28/migrating-asp-net-mvc-2-applications-to

Exception escapes from workflow despite TryCatch activity

北城余情 提交于 2019-12-11 12:02:11
问题 I have a workflow inside a Windows Service that is a loop that performs work periodically. The work is done inside a TryCatch activity. The Try property is a TransactionScope activity that wraps some custom activities that read and update a database. When the transaction fails, I would expect any exception that caused this to be caught by the TryCatch . However, my workflow aborts. The workflow I have is the following: var wf = new While(true) { Body = new Sequence { Activities = { new

ASP.NET Webforms Project created with VS2012 RC does not run in VS2012 RTM

∥☆過路亽.° 提交于 2019-12-11 11:54:35
问题 I used the RC version of Visual Studio 2012 to create an ASP.NET Webforms project and I intentionally took the 4.0 version of .Net and of the project template to avoid complications after the release of VS2012. Now I anyway bumped into the problem, that is revealed in the following error message: 'jquery' is not a valid script name. The name must end in '.js'. As I noticed in the references, following assembly references are broken: Microsoft.ScriptManager.jQuery Microsoft.ScriptManager

SignalR .Net client fails to connect (upd: how to set auth. cookie?)

孤街醉人 提交于 2019-12-11 11:43:17
问题 This thing is dragging me nuts. I have a .net 4.0 console app and I have an MVC web app. javascript clients can connect and talk to the server - no problems here... but my .net client throws System.AggregateException with InnerException = "Unexpected character encountered while parsing value: <. Path... so I created an empty MVC3 app, added SignalR libraries, and .net client surprisingly connects to that. But for some reason it doesn't to the other one. I've checked everything, both MVC3 apps

GetAuthorizationGroups returns more groups than my user is in

*爱你&永不变心* 提交于 2019-12-11 11:38:47
问题 i found this post to get the security groups of a user. I had to change it a bit so it looks like this: public List<GroupPrincipal> GetGroups(string userName, string userPassword, string userDomain) { List<GroupPrincipal> result = new List<GroupPrincipal>(); // establish domain context PrincipalContext yourDomain = new PrincipalContext(ContextType.Domain, userDomain, userName, userPassword); // find your user UserPrincipal user = UserPrincipal.FindByIdentity(yourDomain, IdentityType

Read a dynamically created textbox in a Gridview

不想你离开。 提交于 2019-12-11 11:22:10
问题 I am dynamically adding a textbox to certain rows (one column only) of a gridview. I add the controls with this insdie of a test condition (works fine): TextBox txtASIN = new TextBox(); txtASIN.ID = "TxtASIN" + e.Row.RowIndex; e.Row.Cells[4].Controls.Add(txtASIN); int i = e.Row.Cells[4].Controls.Count; //TEST: This returns 1 correctly I want the user to be able to enter values into one or more of these textboxes and then update the database with a single button click (not one click for each

.Net Redirecting requested assemblies to different version

你。 提交于 2019-12-11 11:15:34
问题 I have an assembly that is version 1.0.0.0 and a new version that is 2.0.0.0. Both are installed in my GAC. Currently I can use the "Configured Assemblies" section in the ".NET Framework 2.0 Configuration" tool to enforce that any requests for 1.0 are sent to the 2.0 assembly on my server. This still works the same with 4.0 framework but I need to install teh .Net 2.0 SP1 to get the 2.0 configuration tool. I believe you can also do this with "Publisher Policies" but these seem to be a bit

Exclude directories that contain sub directories?

三世轮回 提交于 2019-12-11 11:01:33
问题 I have the following code: var directories = Directory.GetDirectories( environmentSettings.SourcePath, "*", SearchOption.AllDirectories) .Where(dir => !environmentSettings.FolderExclusions .Contains(Path.GetFileName(dir))); I want to create a directory in the target path except for ones that show up in the exclusion list. This works, but only if the directory is directly under the root and does not contain sub-directories. As an example, if the exclusion list contains a directory called

WCF Message serialization leaking event handles and unmanaged memory

此生再无相见时 提交于 2019-12-11 10:48:40
问题 We have a WCF client and we need to save the request before we send it, however after every serialization there are some leaked windows event handles. We've tried windbg but the handles are created by the clr. Using sysinternals handles.exe reveals that Semaphores and Events are constantly increasing, the unmanaged memory is also increasing: Handle type summary: ALPC Port : 10 Desktop : 1 Directory : 5 EtwRegistration : 16 Event : 574 File : 12 IoCompletion : 3 Key : 13 KeyedEvent : 1 Mutant