Silverlight debugging; not attaching process - silverlight

I use Google Chrome as my default browser but prefer to use Internet Explorer for debugging Silverlight applications. I therefore set my web project properties thus and check the Silverlight debugger option.
This has worked fine for ages but since returning from vacation I find that the iexplore.exe process running silverlight is no longer attached to the debugger and I must attach it manually. When not debugging my app I can check the Debug | Attach to Process... dialog and see that there are no instances of iexplore.exe running. Then I hit F5 and start a debug session and look again, after which there are two instances, one of which is attached, but not the one running Silverlight. Once I attach the other too, debugging works fine and I can hit breakpoints and step through the code with no problem.
Any ideas on what I'm missing to get the debugger attaching to the correct process would be appreciated.

Chrome is my default OS browser, but I use IE for SL debugging.
What I do is find the ASPX page in the hosting Web project in the solution view of Visual Studio. Right-click the file and select Browse With. You'll be presented with a dialog. Select IE from this list of Browsers and press the Set as Default button. I then cancel out of this dialog. Now when VS starts debugging it uses IE! You'll need to undo your "Start external program" debugging options in the project (switch back to Current/Specific Page).
VS will occasionally "forget" this setting and switch it back to Chrome. Just repeat this process.

Related

Debug XBAP hosted in WPF Application

I have a WPF Application (say, WPF.exe) with multiple tabs. In one of the tabs, I display a *.xbap using: WebBrowser tag.
<WebBrowser Source="c:/PublishedWebSites/Test.xbap"/>
When I start WPF.exe, I am able to attach debugger to any other UserControl but not to my XBAP. I also tried attaching my XBAP to PresentationHost.exe process which was started when I click on the browser tab.
The break points are not hit in XBAP project, though I verified that when I publish the XBAP, I oublish *.pdb files as well.
Could anyone tell me what I am doing wrong here?
Thanks,
RDV.
I could debug. Steps:
1. Compile and Publish XBAP. DO NOT change anything after publishing.. in case you do.. republish it.
2. Ensure there are no PresentationHost.exe processes running.
3. Run the WPF application. Launch XBAP (as one of the tabs ..in my case).
4. Debug->Attach to process-> Connect to PresentationHost.exe=> ensure that you select the correct 32 vs 64 version (i think this was my mistake).
Thanks,
RDV

Getting only gray screen when launching citrix application

Recently we installed a .net WPF application on citrix. When I go and launch it from citrix using RES powerfuse, I only get a grey screen and no controls are rendered on the screen.
The application is open and the main window can be seen but everything is grey in it. The mouse pointer also disappears behind the application.
The funny part is when the people from the operations team launch the application, it works fine. but not for regular users. This makes me suspect it could be something to do with permissions, yet we have given the access to open the program to all users, thats why the icon appears in citrix in the first place
What server are you running the app on? I recall we hit a WPF rendering bug on certain versions of Windows Server (+ XenApp) where the app would only render properly for administrators. This was a .NET bug - nothing to do with Citrix per-say. From what I remember the WPF rendering engine was trying to get access to some system resource that regular users could not access. I believe we only saw this on 2003 servers.
Just did some further digging, I think this is the issue:
http://support.microsoft.com/kb/955692
For quick n temporary resolution:
Check your local machine resolution and Citrix desktop/application resolution.
Equalise the both it will work.
Ex: 1024/762 is the right resolution.
For test: Do maximise n minimize the screen you will see the change.

Silverlight project won't enter debug mode

My Silverlight project in VS 2010 has stopped entering debug mode. Even if I set a breakpoint in the constructor of the Application class, it refuses to hit any breakpoints. My other projects are still fine, but I can't find any setting that may have accidentally gotten changed to keep me from debugging. What could be going on?
Open the properties of the associated Web Project. Select the Web Tab. Scroll to the bottom and in the "Debuggers" section make sure "Silverlight" is Checked.
Not sure what happened, but here's what got it working again.
I changed it to Release mode, compiled it. Closed and restarted VS, changed it back to Debug mode, ran it and breakpoints hit again.
Make sure the dropdown in the toolbar is set to Debug and not Release
While Attaching the process please attach w3p.exe and iexplorer instance of Silverlight this should resolve your issue.

Why does invalid handle exception occur when browsing via WPF WebBrowser control?

I have a WPF app that has a window with a WebBrowser control in it. I navigate to a site like http://www.cnn.com, it loads, and then I get an error when I click a link. This only happens when debugging on a Windows Server VM that has VS 2010 on it. Running the compiled app out of the bin or debugging on my Win7 machine works fine.
With unmanaged debugging off you just get the vshost32.exe has stopped working. The specific error seen if I enable unmanaged debugger is an "invalid handle exception".
Any thoughts on what to look for between the two environments or why this would happen?

WPF XBAP applications blank after second/third deploy?

This has happened repeatedly on various machines in VS2008 and Visual C# 2008.
I create an XBAP appliation.
I click the green arrow and it works.
I click Build/Publish and publish it to either a website or folder, it works.
I make some changes, publish again, and I just get a white screen. Both browsers, can restart, always blank.
It seems to be some kind of caching, etc. Has anyone had this happen to them and found a workaround?
Is the version number incrementing? Right click on the xbap project, go to properties/publish tab, increase the version number and republish.
You can clear the application store using mage -cc command from VS command prompt. Check out this post for more info.

Resources