.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

MediaPlayer hangs, MediaOpened never fires.

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :WPF
 
I tried to make a playlist. Due to the asynchronous nature of the MediaPlayer I put all the files in a Queue and:
1. Tell MediaPlayer to Open a file.
2. MediaOpened fires, I read the NaturalDuration, close the file, and tell MediaPlayer to open the next file in the queue, if any.

The problem is that this process magically stops after processing about 20 files. The next MediaOpened never fires. What to do?

class RecordingFolderWatcher : FolderWatcher<Recording> 
{ 
    class QueueItem 
    { 
        public KeyValuePair<string, Recording>


View Complete Post


More Related Resource Links

MediaPlayer hangs DoubleAnimation

  

hey,

i've built a WPF application with a doubleanimated canvas used for a scrolling bar (textblocks + images), and a MediaPlayer control.

the mediaplayer control plays 5-10 movies in a loop (each time the MediaEnded event fires, i use MediaPlayer's control Open method to play the next movie).

 

my problem is, that each time a movie ends and a new movie loads/starts playing - the scrolling bar gets stuck for about a second until the movie starts. 

i assumes that it happens while the new movie loads, but i'm not sure. i tried to create a new UI thread just for the scrolling control, but it didn't fix the problem.

 

any help/advice would be appreciated.


No More Hangs: Advanced Techniques To Avoid And Detect Deadlocks In .NET Apps

  

You can combat deadlock using a combination of disciplined locking practices which Joe Duffy aptly explains in this article.

Joe Duffy

MSDN Magazine April 2006


Using Dynamic Property inside Html Helper with Razor fires an error

  

Hello,

I have the following with Razor:

@Html.GoogleAjax(View.GoogleAjaxKey, new String[,] { { "jquery", "1.4.2" } })

And the I get a strange error:

  'System.Web.Mvc.HtmlHelper<object>' has no applicable method named 'GoogleAjax' but appears to have an extension method by that name. Extension methods cannot be dynamically dispatched. Consider casting the dynamic arguments or calling the extension method without the extension method syntax.

What is strange is that it works fine using:

@Html.GoogleAjax("123", new String[,] { { "jquery", "1.4.2" } })

I tried the following code line:


@View.GoogleAjaxKey

And the key is displayed just fine so the problem is how I use the value of @View.GoogleAjaxKey into Html.GoogleAjax.


Do I need to change something on my Html Helper? Here it is:


    public static MvcHtmlString GoogleAjax(this HtmlHelper helper, String key, String[,] libraries) {

      

user control derived from System.Web.UI.WebControls.WebParts only fires its OnPreRender and CreateCh

  

 I have a application which uses webparts.

So my user controls are derived from System.Web.UI.WebControls.WebParts which makes them webparts.

I have everything setup and working fine as far as the personalization and webpart goes... every thing displays and works fine.

Except that 1 of my control needs to do a bit of work in the OnPreRender event and it turns out that event only gets fired when a user is loged in the application.

So lets imagine that an administrator while logged in switched to 'Sharedscope' within the webpartmanager and then has added the usercontrol/webpart 'calendar' to the top webpart zone. This then makes the 'calendar' control viewable by all and any user who visits the page wheter logged in or anonymous.

And this works fine and very well as it is supposed to. However in the 'Calendar' user control which is derived from System.Web.UI.WebControls.WebParts I have an overiden 'OnPreRender' event like this:

Protected Overrides Sub OnPreRender(ByVal e As EventArgs)

If Not Me.DesignMode Then

Me.isloaded = True

' Test for ScriptManager and register if it exists

sm = ScriptManager.GetCurrent(Page)

If sm Is Nothing Then _

Throw New HttpException("A ScriptManager control must exist on the current page.")

Data flow task with multiple destinations randomly hangs

  
I have a package whose control flow consisting of a single data flow task with multiple destinations continues to hang at random locations.  The data flow task is fairly simple: - One OLE DB source (one query of selecting about 10 fields from one table) - 9 lookups that serve basically as left joins to capture which data "drops off" (does a row redirect on on lookup errors to an "error flow") - Two destinations: one the captures all the data that doesn't drop off from the lookups, and another to capture the data that does drop off; these write to two tables unrelated to each other, and unrelated to any of the tables I'm reading from I have tried the following: - Changed one or both destinations from OLE DB to flat file -- still randomly hangs - Removed both destinations altogether -- this always suceeds.   - Removed destination A and leave destination B -- this always succeeds - Removed destination B and leave destination A -- this always succeeds I took great care in making sure I get no warnings when the package runs, even resolving the unneeded column warnings, and the duplicate keys on all my lookups, but it still hangs. However, once I give up and stop the package, the following error is thrown (among others that appear to be a byproduct of the root issue): Error: 0xC02020C4 at Data Flow Task, OLE_SRC AP12 [1]: The attempt to

Load fires twice.

  
I just noticed that after I migrated my project Load event started firing twice and even code in if(!IsPostBack) fires twice. It seems to be that the reason is that asp.net 2.0 adds Page_Load automatically for Load event and since in 1.1 version there was line like:  this.Load+=new EventHandler(thi.Page_Load); it is added second time. For some reason in my case this line wasn't removed by "Convert to Web Application" command. Just wanted to make sure that I have to do it myself and that this know bug. Thank you, Shimon.

RegularExpressionValidator always fires

  
Hi friends,I am trying to use a RegularExpressionValidator for email ID text box. Everything works fine till I add an AJAX TextBoxWatermarkExtender for the same text box. I have given the WatermarkText="Email" for the text box. When I push the submit button, the RegularExpressionValidator fires and says Invalid Email ID. When I clear the same text box, no issues and the records are saved.I strongly suspect that the RegularExpressionValidator is taking the text of the watermark, ie "Email" as an invalid email ID. To test this I gave the text as "someone@website.com" for the  TextBoxWatermarkExtender and it did not fire the RegularExpressionValidator.The Email ID field in my page is not mandatory but should have a valid email ID. Have any one faced same issue and does any one have a solution to this?I am pasting the code below:<asp:TextBox ID="txtEmail" runat="server" MaxLength="50" ToolTip="Enter Email" CssClass="input" ValidationGroup="register" > </asp:TextBox> <cc1:TextBoxWatermarkExtender ID="txtEmail_TextBoxWatermarkExtender" runat="server" Enabled="True" TargetCo

user control derived from System.Web.UI.WebControls.WebParts only fires its OnPreRender and CreateCh

  
I have a application which uses webparts. So my user controls are derived from System.Web.UI.WebControls.WebParts.WebPart which makes them webparts. I have everything setup and working fine as far as the personalization and webpart goes... every thing displays and works fine. Except that 1 of my control needs to do a bit of work in the OnPreRender event and it turns out that event only gets fired when a user is loged in the application. That control is also a script control so it inherits from System.Web.UI.WebControls.WebParts and also implement IScriptControl So lets imagine that an administrator while logged in switched to 'Sharedscope' within the webpartmanager and then has added the usercontrol/webpart 'calendar' to the top webpart zone. This then makes the 'calendar' control viewable by all and any user who visits the page wheter logged in or anonymous. And this works fine and very well as it is supposed to. However in the 'Calendar' user control which is derived from System.Web.UI.WebControls.WebParts I have an overiden 'OnPreRender' event like this: Protected Overrides Sub OnPreRender(ByVal e As EventArgs) If Not Me.DesignMode Then Me.isloaded = True ' Test for ScriptManager and register if it exists sm = ScriptManager.GetCurrent(Page) If sm Is Nothing Then _ Throw New HttpException("A ScriptManager contro

SPD workflow status show "starting" when I create a document from the library !!. and hangs

  
I have a document library in MOSS 2007. Have created a WF and that starts "autmatically when new item created" In the document library I have created couple of column those are mandatory (required columns) and user has to fill those column while uploading a document as well creating a document from library. WF has ran and completed succefully  when I use "upload" option to load a document.  As you are aware, when we "upload" a document, we will have to fill all "required columns" and the click "check in" command button.  After I do all this, document get loaded and WD ran succesfully. However, the WF is not running when I create a document (.docx) from this library (using "new" button) !!.  I have filled all required field in the document information panel . After save & exit from WORD application, I can see WF status as "starting". But, it never started and completed.  So I did following and found WF worked !! a) After creating document (.docx) using "new" option I found WF status "starting"!. So,  I did "Check-out and Check-in" manually from document library. After doing this,  WF ran and status has been changed as "completed" b) In SPD, I change workflow start option from "Automatic" to "Manually start".&nb

Bug in ODBC SQL Server driver (SQLFetch hangs)

  
I have come across a bug in the ODBC driver for SQL Server when working against SQL Server 2008 64-bit with TDE where tables contain text-datatypes. We concluded that it is a bug after testing a simple SQL query using Microsoft ODBC test tool (odbcte.exe) and the workaround for us was to start using the "SQL Native Client 10" instead. However I would like to share this information if someone else come across this problem. Below I will describe the problem in more detail. The table has three columns with text datatypes and we use a simple select query against this table to return about 10 rows of data but SQLFetch hangs before all data is returned. It is unfortunately very difficult to reproduce the errror since even a very small change will change the behaviour. If we for example add or remove a column to the select statement then the problem will dissappear, if we call SQLBindCol before instead of after SQLExecute (or the other way around) the problem will dissapear, if we change the WHERE-clause to fetch a different set of rows the problems will dissapear. We have seen the problem though with a number of different SQL queries so it is reproducable.

OpenQuery() to Linked Server hangs, leaving SPID with open tran, then templog.ldf grows without limi

  
Hi, We have a customer that is using SQL Server 2000, and experiencing the following intermittent problem -- occasionally templog.ldf will grow and grow until it fills the entire disk. This is a rare problem, it has happened less than 10 times in the past two years, for a job that runs once a minute. But it has happened on 3 different SQL Servers, (two production servers, and one test server). Our suspicion is that the root cause is an OPENQUERY() to pull data from a linked server (Oracle database on Unix). We have seen that these OPENQUERY() statements occasionally hang and cannot be killed. The OPENQUERY() is used to populate a local table, and when we originally populated permanent tables with OPENQUERY(), then there would be a lock on this permanent table and nothing could be done until SQL Server was stopped and restarted. To workaround the immediate problem, last year we modified all OPENQUERY() statements so that the local table was a #temp table. In that case, cancelling the job left the hung process, but the hung process had a lock on a #temp table and so that didn't keep the next execution of the job from creating a new #temp table and populating it. However... it appears that the hung process, because it leaves an SPID with an open transaction, keeps the tempdb log file from being truncated. And eventually you run out of disk space, no matter how much disk space is

user control derived from System.Web.UI.WebControls.WebParts only fires its OnPreRender when a user

  
I have a application which uses webparts and 1 control is also a Script Control. So my user controls are derived from System.Web.UI.WebControls.WebParts.WebPart which makes them webparts. I have everything setup and working fine as far as the personalization and webpart goes... every thing displays and works fine. Except that 1 of my control needs to do a bit of work in the OnPreRender event and it turns out that event only gets fired when a user is loged in the application. That control is also a script control so it inherits from System.Web.UI.WebControls.WebParts and also implement IScriptControl So lets imagine that an administrator while logged in switched to 'Sharedscope' within the webpartmanager and then has added the usercontrol/webpart 'calendar' to the top webpart zone. This then makes the 'calendar' control viewable by all and any user who visits the page wheter logged in or anonymous. And this works fine and very well as it is supposed to. However in the 'Calendar' user control which is derived from System.Web.UI.WebControls.WebParts I have an overiden 'OnPreRender' event like this: Protected Overrides Sub OnPreRender(ByVal e As EventArgs) If Not Me.DesignMode Then Me.isloaded = True ' Test for ScriptManager and register if it exists sm = ScriptManager.GetCurrent(Page) If sm Is Nothing Then _ Throw New Ht

Visual Studio Hangs when Creating a New Website or Project

  
Greetings, Just as the subject says, my VS'05 installation hangs when trying to create a new website.  I even installed a fresh version of VS08 along side '05 and '08 is doing the same.  Any ideas on a fix or where to look? Thank you in advance. 

HttpModule which only fires a few times, then never again

  
I've got a debugpoint inside the init of my HttpModule.public void Init(HttpApplication context){            int a = 2;            int b = a;            int c = 3;}As simple as that. Basically I just put code in there to make sure it fires. So at first when I debug my site this fires a couple of times (for each file loaded). Then I go to a second page, and it fires again. After that, I never get to that breakpoint again. Why is this?I'm having trouble with SessionState in my httpmodule on this specific site. context.Current.Session is null. I've tried both PreRequestHandlerExecute and BeginRequest. But the first thing I want to fix is to make the HttpModule to ALWAYS fire.

networkstream.read hangs

  
hi there,my php-script sends some data to my c#-appand listens to the answer: Code Snippet <?$fp = fsockopen($host,$port);fputs($fp,'daten');$buffer = '';while (!feof($fp)){    $buffer .= fgets($fp,128);}echo $buffer;?> my c#-app has to receive these and sends a answer backto the php-script: Code Snippet //....NetworkStream stream = client.GetStream();string result = "";byte[] buffer = new byte[128];int i = stream.Read(buffer, 0, buffer.Length);while (i > 0){  i = stream.Read(buffer, 0, buffer.Length); // Here it hangs!!  result += ASCIIEncoding.ASCII.GetString(buffer);}// Here i would send the data back//....sadly the program hangs on the stream.read in the loop.any idea?thanks a lot  greez nullpunkt

VS 2008 Design Mode Hangs on Windows 2008 Server

  
 I have looked at all the posts I can find on this problem and tried everything I can think of, but still the problem persists. I am getting really sick of it. It was working fine for the last year until an update to MS Office 2007 caused a lot of problems (automatic update). After checking posts here, I removed it completely. No change. I then tried all the things I could find on other posts, also no change. Today, I removed VS and the Web Authoring Component and re-installed. Still no go. Does anyone have a fix for this problem. It seems that it has been around a long time, but is still giving problems. I even saw one suggestion to reformat the drive! You've got to be joking! Help please, I'm getting desparate.  

Processing hangs

  
Hoping someone out there knows this error or possibly can help me to find out the reason. We have a SQL Server 2008 relational Database as the source for SQL Server 2008 cube. The cube will be processed by a SQL Server job using XMLA command. <Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine"> <Parallel> <Process xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100"> <Object> <DatabaseID>MyDbName</DatabaseID> </Object> <Type>ProcessFull</Type> <WriteBackTableCreation>UseExisting</WriteBackTableCreation> </Process> </Parallel> </Batch> Our environment is: Windows Server 2008 SP2, x64 MS SQL Server 2008 Enterprise SP1 VM-Ware Maschine Processor: AMD Opteron 8381 HE (QuadCode 2,5GHz) Memory: 8 GB The problem is: sometimes (not always) the job step for processing hangs until we restart the analysis service. The CPU is not busy, no error entries in windows event log, no entries in msmdsrv.log (Analysis Services-Log), n
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend