WPF XBAP applications blank after second/third deploy? - wpf

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.

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

What's different about Screensaver preview in Windows 8?

I'm working on a simple WPF-based screensaver and can't get the thumbnail preview to work.
When you open the display control panel and go to configure the screensaver, the selected screensaver is supposed to display a thumbnail preview within the dialog:
I've found several good examples online of how to do this, including:
Writing a screen saver in WPF
WPF Screensaver (Codeplex)
CC Hearts Screen Saver
Following these examples, I couldn't get anything to work - the preview thumbnail turns black, but nothing else appears. Downloading each of these (and a few others) and running them had the same result - a blank preview thumbnail. I've done this before on Windows 7 and it wasn't hard, so I was a bit frustrated.
Copying the binaries across to a Windows XP machine, I found that each of them showed a preview thumbnail successfully.
So, there's something that's changed between Windows 7 and Windows 8.
What do I need to do differently to enable my WPF screensaver to properly display a thumbnail preview on Windows 8?
I've found the most common problems with moving code from Win 8 to Xp is permission and dependencies. Check that the files are not needing some weird permissions (not sure what permission the preview runs with) and that all dependencies are honoured (also their permissions).
If I remember right, all windows screen savers are just renamed exe files with command line arguments. Maybe try rename it and run it directly?
Check what version of the framework you are using and try to use the client profile if possible
Also Try this small workaround if helps:
In Windows Explorer Go to > Options > Change folder and search
options then click on the View tab and uncheck the box that
says Always show icons, never thumbnails.
I hope it should work.

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 debugging; not attaching process

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.

Why do my toolbox items disappear in Visual Studio 2008?

I'm working on a solution that contains multiple projects targeting Windows Mobile 5 and standard Windows applications.
Lately when opening up a form in designer the common UI controls (textbox, button, label, etc etc...) have vanished leaving only the controls defined within the project.
Resetting the toolbox has no effect. A google search suggested deleting the toolbox temp files in the Local Settings\Application Data\Microsoft\VisualStudio\9.0, however this was only successful in bringing back the default controls for Windows Mobile 5. The WinForms controls are still mysteriously missing.
Also, if I right-click and Select All on the toolbox, all of the WinForms controls do in fact come up, however they're all grayed out.
Has anyone else experienced this?
I just had a similiar problem. In a managed C++ project all the default toolbox items disappeared form the winforms designer. After playing around for a while I found that there was a problem in the .vcproj file.
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="COLLADA Import"
ProjectGUID="{0DEEF9B6-1929-44E3-92EC-13712839FB63}"
RootNamespace="COLLADAImport"
Keyword="ManagedCProj"
TargetFrameworkVersion="0"
>
When you set TargetFrameworkVersion to a valid number, for example 131072 for .Net 2.0, the toolbox items will be back.
If you right click on the Toolbox and select 'Choose Items...' and then sort by the 'Namespace' column, you can then select the ones you need (for example System.Windows.Forms for WinForms).
You can multiselect with Shift and then select/deselect the group.
The controls then reappear in the Toolbox as enabled.
I've noticed this exact same thing for regular WinForms as well. I can't speak to mobile applications but in regular winforms this has a tendency to happen.
I believe it's actually a bug in Visual Studio.
There are some things you can do (again, for WinForms. I'm not sure about mobile) with adding attributes to your control. Such as:
[ToolboxBitmap(typeof(MyControl), "MyControlBitmap")]
There are some other useful related things on this site:
http://en.csharp-online.net/Design-Time_Integration-Attributes
I had exactly the same problem (after installing Windows Mobile SDK all items in the toolbox were greyed out).
I've startet the Visual Studio 2008 command line as administrator and started the following command (WARNING - all your settings are lost !!)
devenv /setup /resetuserdata /selfreg /resetskippkgs
After that the toolbox looked fine and worked like on the first day.
The idea came from this thread: connect.microsoft.com
Go to the Tools menu and choose import & export settings, then choose the 'reset all' setting, then yes. Save your current settings, after that you'll have your toolbox reappear.
Actually you may be able to add a registry key to get this to work also.
Make sure you're not in Debug mode.
If you are running Visual Studio 2008 under vista, try running it as an Administrator. Right click on the shortcut and select Run as Administrator.
Well guess what install Service pack 1 for VS 2008 and it would go away and if you have wireless mouse and keyboard turn it off. Choose one of these two both work.

Resources