Saturday, June 16, 2012

LinqDataSource Control "Exception has been thrown by the target of an invocation."

Symptom


  • You are running Visual Studio 2010 SP1
  • You have an ASP.NET web page
  • You have dragged the LinqDataSource onto the design surface
  • You try to Configure Data Source and get the following error message
 Exception has been thrown by the target of an invocation

Root Cause

  • Appears to be Related to .NET Framework 4.5 present (as a result of installing Visual Studio 2012).

Fixes That Would Not Work

I have tried the following and none worked. So you may not want to go down the same path.
  • Use devenv /Log to find out what's happening.: It will not log anything useful.
  • Start devenv in /Safemode.: No effect
  • Repair Visual Studio 2010
  • Uninstall Visual Studio 2010 (note if you do this you will have to apply SP1 which takes a long time)
  • Remove or Repair Sliverlight SDKs
  • Remove or Repair .NET Framework 4.5

Possible Fix If You Do Not Need VS 2012

The following steps fixed my situation. You do not need to uninstall SQL 2012 Express
  • Uninstall VS 2012
  • Uninstall .NET Framework 4.5
  • Uninstall .NET 4.0 Multi-Traget Pack
  • Using VS 2010 Installer, Perform the Repair of VS 2010

Workaround If You Need VS 2012

  • Try another machine or a VM you have not installed anything "2012" on it, you should be able to continue to work on LinqDataSource. Once the LinqDataSource is configured, check the code in and it should work on your "corrupted" environment, though you won't be able to change anything in the data source. You can still work with the Data Grid to which the data source is connected and do add/remove columns and such. You can manually edit the web page source code to change minor things like some query changes.
  • If you can safely move up to VS 2012, then the LinqDataSource will work perfectly fine there.







Thursday, June 14, 2012

Firefox: WebGL Not Functional: Blocked for your graphics card because of unresolved driver issues

Symptom:


WebGL does not render at all on some graphics cards on the latest/later Firefox browser for Microsoft Windows for example Firefox 12. If you look at the Help->Troubleshooting page (or simply type in about:support in the URL) on Firefox, you see

WebGL Renderer Blocked for your graphics card because of unresolved driver issues.


By now, you probably figured you need the graphics driver installed (which is the first thing you should try), but still to no avail.

But if you use Google Chrome, WebGL probably works fine. The good way to test this is to go to the Chrome Experiments web site. For example, http://www.chromeexperiments.com/detail/webgl-aquarium/?f=webgl

Root Cause:


There is a fairly limited set of conditions in which WebGL is activated with the Google ANGLE WebGL rendering engine which Firefox for Windows uses. Rather than crashing the browser when WebGL functionality is dicey, Firefox has a Driver Blacklist and it is very likely that your graphics card and/or the driver version has been blacklisted.

Some graphics cards are simply not supported yet as they cause crash, which leads to poor user experience and developers do not want that to happen for regular users. Also since anything outside of NVIDIA and ATI will not be supported, unfortunately.

If you are using Remote Desktop, then the WebGL driver will be automatically disabled.

In addition to the model of the graphics card, if your laptop contains NVIDIA Optimus Technology, which allows you to use both GPU and the integrated (e.g., Intel HD 3000) graphics on laptops, then it is also subject to be blacklisted by Firefox, even if the base desktop model of the GPU works OK with Firefox. This was my situation.

Fix:


  • If you do not have NVIDIA or ATI graphics card, all bets are off. If it is a desktop, you could swap the card with at least some mid range "gaming" class graphics cards.
  • You cannot use Remote Desktop or most other ways to delegate the graphics driver such as virtual machines. Walk over to your computer and use its own display.
  • If you have a laptop computer with Intel Graphics integrated then turn off your GPU. I have the Intel HD 3000 graphics on my laptop and actually the built-in GPU works fairly well on Firefox. I get about 40 FPS with the HD 3000 and 60 FPS with the GPU on.
  • If you have read above mentioned black list article on the Firefox Wiki, it explains the way to force-enable WebGL. This, however, will be a very risky proposition and may render your Firefox  unusable. So if you don't want to risk this much and Chrome is working for you I would suggest you stick with Chrome for WebGL. These days, it is always good to get used to more than one browsers. Note that Internet Explorer and Apple Safari do not directly (out of the box) support WebGL.


Tuesday, June 12, 2012

Visual Studio 2010 Startup Very Slow

Symptom:


When I launch the MS visual studio 2010, it is really slow in coming up.

My Root Cause:


There are of course many root causes of this, but in my specific situation, it was the Microsoft Fusion Log left enabled.

I had to diagnose assembly loading errors previously using Fusion Log and I configured and left this on. This will cause a significant slow-down in your computer operations.

My Fix:


First you can check to see if Fusion Log is enabled. You can generally find this out by running the new Resource Monitor that comes with Windows 7 and 2008 family of OS. You will find that there is a lot of disk I/O with respect to the fusion logs.

Second you can check in the Start Menu, under Visual Studio 2010 -> Microsoft Windows SDK Tools -> Fusion Log Viewer

You may find this in the situation where the logging is stuck and you cannot disable it.

If you find that you cannot disable it, you many need to do the following registry tweaks. You may not find all of the keys, but do not worry, just remove the ones that are still there.


HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion

Remove the following keys

ForceLog
LogFailures
LogResourceBinds
LogPath 

Conversely, if you want to re-enable fusion logging...

DWORD ForceLog set value to 1
DWORD LogFailures set value to 1
DWORD LogResourceBinds set value to 1
String LogPath set value to folder for logs, for example D:\FusionLog\

Restart your computer just to be extra sure and you should be fine after this.

Monday, June 11, 2012

IE 9 Crashes on MSN

Symptom:

You open IE 9 and go to http://msn.com   IE 9 crashes with the "Internet Explorer Stopped Working" dialog box.

Root Cause:

I do not know. I am suspecting that it is the Flash player.

Fix:


  • Try manually re-installing the latest version of Adobe Flash player. In my case this has corrected the issue.
  • If going to MSN is only your goal, MSN works perfectly fine with Firefox or any other non-Microsoft web browsers.
  • If you have to use the IE for testing and debugging and such, you can go to Internet Options on the control panel and make the home page to Blank.






Saturday, June 09, 2012

VS 2010 Web Debug Fails To Start Due to "Invalid file name for file monitoring"

Symptom:

You try to launch your ASP.NET web application from Microsoft Visual Studio (2010) and you get the following error (you swear it was working an hour ago.) Note that the file name mentioned does not really matter. The symptom is that you cannot launch a web page in debug mode.

Invalid file name for file monitoring: 'C:\Blah\Whatever\App_LocalResources'. Common reasons for failure include:

Cause:

The root cause is completely understood, but it has something to do with catching all un-handled CLR exceptions in the debug menu.

My Fix (May Not Work With You):


  • Go to Debug->Exceptions and un-check all un-handled exception checking.
  • Try to launch the debug session again. This time, it worked for me.
  • Go to Debug menu and then clear all break-points. This time, I can re-enable un-handled CLI exceptions and back to be able to launch and debug the app.
  • If above does not work, clear the .NET temp files for the framework version you are using. For example,

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files




Tuesday, June 05, 2012

Windows 7 Desktop Freezes Up But Start Menu OK

Symptom:

For "no obvious strange reasons" (actually for a good reason, see the cause below) the Windows 7 desktop suddenly freezes. For example, you cannot "right mouse click" on any items on the desktop. But Start Menu works just fine.

Cause:

This turns out to be iexplorer.exe process not completely closing down. You can find out if this is actually your case by going to the task manager and manually killing the iexplore.exe (may have *32 next to it if you are running a Windows 7 64-bit version)

Fix:

This may be due to the IE configuration or plug-ins being messed up. You can optionally reset the IE settings using this information.

IE is totally a fine browser but you can use Firefox as your default browser and you can avoid this problem in exchange for possibly other problems.

Note:

Around June or July of 2012, my Google Chrome is starting to exhibit similar behavior. I am investigating but usual "clean everything" seems to be working.



Saturday, June 02, 2012

Visual Studio 2012 Show Stopper Collections

Just installed the VS2012 RC a few days ago. I am tallying any show stoppers.

SQL CLR "Corruption"


Symptom:

I had an MSMQ triggering CLR in SQL Server 2012 Express. It seems that after installation of VS2012 the assembly stopped working.

When the assembly was called from a stored procedure, I got a message somewhat like this:

Server: Msg 6522, Level 16, State 2, Line 1
A .NET Framework error occurred during execution of user defined routine or aggregate 'getsid':

System.IO.FileLoadException: Could not load file or assembly 'System.Messaging, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Assembly in host store has a different signature than assembly in GAC. (Exception from HRESULT: 0x80131050)

System.IO.FileLoadException:

Fix:

You can correct this condition by ALTER ASSEMBLY. For example, if the Messaging DLL is corrupted in the above manner, I would do;

ALTER ASSEMBLY Messaging 
FROM
'C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Messaging.dll'
WITH PERMISSION_SET = UNSAFE 
GO

Note, be sure to exit Visual Studio 2012 when you do this. You may get yet another issue which results in "Out of Resource" error.


Other Possible Issues:


  • Exception has been thrown by the target of an invocation when dragging in the LinqDataSource control. -> See This Article