.net-4.0

WPF/XAML Application Crashes when Blend not installed - Event Logs Attached

北城以北 提交于 2019-12-12 10:20:41
问题 Below is the full XAML for the WPF application, no codebehind. On computers that have Expression Blend 4 installed, the following application works. However, on machines that do not have Blend, the application crashes. This is extremely simplistic, but it appears that the [i:Interaction.Behaviors] portion is what is causing the issue, which is a behavior from Blend that creates a smooth animation. <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http:/

UrlRewriter.NET with .NET 4.0 not working

a 夏天 提交于 2019-12-12 10:09:10
问题 I have a web project that had UrlRewriter.NET installed and working fine on .NET 3.5 locally. I then upgraded it to .NET 4.0 and this continued to work on my local PC in Visual Studio 2010. When I moved this .NET 4.0 project to my server the url rewriting stopped working. Here is my web.config (condensed for readability here) <?xml version="1.0"?> <configuration> <configSections> <section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration

Parse MP3 file in .NET v4.0

泄露秘密 提交于 2019-12-12 09:59:25
问题 How can I parse an MP3 file to get its all attributes? Also how to edit and the attributes of the MP3 file? Is there any class available in .NET v4.0? 回答1: Those attributes are called ID3 tags. I do not think it is the scope of the .NET framework to provide reading them. Here is some code from SourceForge. http://sourceforge.net/projects/csid3lib/ 回答2: You might have a look at the taglib library for .NET. It can do both reading and writing of id3 tags among other things. 来源: https:/

WCF says it exceeds maximum query string value while it is not

China☆狼群 提交于 2019-12-12 09:49:48
问题 I have a WCF service (over a webHttpBinding ) using ASP.NET 4/IIS 8 and I had no problems communicating with it using JSON with GET . However, today I needed to implement a method that sends a large query string (about 3000 characters, not that long but longer than that I've been using). I called the service and immediately got a 404 error, without even stepping into my code at my debug machine. The first thing that came to my mind is the maximum query string length limit. I've added this to

How do I find out the actual SQL that this statement generates?

余生颓废 提交于 2019-12-12 09:44:57
问题 I an using VS2010, .NET4 and EF4. I would like to see the actual SQL that is generated when this is run. Also, what is this the best way to write this statement? Here is my code: var cklContactItems = from a in dbTestCenterViews.appvuChecklistExports where a.MarketChecklistID == MCLID && a.checklistSectionID == SID && a.fieldGroupOrder != null orderby a.fieldGroupOrder ascending select new { a.Column1, a.Column2, a.Column3, a.Column4, a.Column5,a.Column1FieldID,a.Column2FieldID,a

How do I get the ID of the current logged in user?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 09:41:33
问题 I'm working on a sample project built from the ASP.NET Web Application template (web forms, not MVC). After a user logs in, I want to grab the user's ID and store it in a session variable so I can pass it between pages. How do I get the user's ID from the ASP.NET membership provider? By user's ID, I'm referring to the GUID in the membership database. Is there a method to get the user's ID? I'm using the default database schema and have it deployed to my server. Thanks! 回答1: Try this:

Forms Authentication adding additional information along with ReturnUrl

ε祈祈猫儿з 提交于 2019-12-12 09:41:27
问题 With Forms Authentication when the app needs to redirect to sign-in page is there an event or any extensibility point that will let me do additional work to the request before it redirects to the sign-in page? I would like to send additional information in the query string that could vary such that it wouldn't work to just statically embed that in the link in the loginUrl node in the web.config. Edit: For clarification, I want to intercept the request prior to being redirected TO the login

Which way is preferred when doing asynchronous WCF calls?

冷暖自知 提交于 2019-12-12 09:38:02
问题 When invoking a WCF service asynchronous there seems to be two ways it can be done. 1. WcfClient _client = new WcfClient(); public void One() { _client.BegindoSearch("input", ResultOne, null); } private void ResultOne(IAsyncResult ar) { string data = _client.EnddoSearch(ar); } 2. public void Two() { WcfClient client = new WcfClient(); client.doSearchCompleted += TwoCompleted; client.doSearchAsync("input"); } void TwoCompleted(object sender, doSearchCompletedEventArgs e) { string data = e

WPF Custom Control, DependencyProperty issue

妖精的绣舞 提交于 2019-12-12 09:23:29
问题 Ive got a test code setup with the custom control: /// <summary> /// Interaction logic for UCTest.xaml /// </summary> public partial class UCTest : UserControl { public static readonly DependencyProperty LastNameProperty = DependencyProperty.Register("LastName", typeof(string), typeof(UCTest), new PropertyMetadata("No Name", LastNameChangedCallback, LastNameCoerceCallback), LastNameValidateCallback); private static void LastNameChangedCallback( DependencyObject obj,

How to implement a Timeout on WebClient.DownloadFileAsync

杀马特。学长 韩版系。学妹 提交于 2019-12-12 09:00:07
问题 So I thought Webclient.DownloadFileAysnc would have a default timeout but looking around the documentation I cannot find anything about it anywhere so I'm guessing it doesn't. I am trying to download a file from the internet like so: using (WebClient wc = new WebClient()) { wc.DownloadProgressChanged += ((sender, args) => { IndividualProgress = args.ProgressPercentage; }); wc.DownloadFileCompleted += ((sender, args) => { if (args.Error == null) { if (!args.Cancelled) { File.Move(filePath,