Reference Silverlight 4 control from Silverlight 3 - silverlight-4.0

Short Question:
If I have a Silverlight application built in SL3 can I detect at runtime if the client is using SL4 and use the Cursors.NESW that is only available in SL4?
More Info:
I have a Silverlight application built using Silverlight 3. I'd like to display a cursor Cursors.SizeNESW in my application. The way I was doing it was to set the Cursor to Cursors.None and display a NESW image in place of the cursor.
However, on Safari on a Mac this causes an issue - Silverlight is running in windowless mode, and if I put an iframe that covers the silverlight app and the cursor is set to none in the silverlight app - then mousing over the iframe will cause the cursor to disappear. I suspect my image cursor is being displayed in the Silverlight underneath the iframe.
Due to business reasons, upgrading to Silverlight 4 for the PC version probably won't happen soon. However, we've had to require Silverlight 4 on the Mac anyway to fix this issue.

I don't think it is possible to mix versions. A project is compiled either SL3 OR SL4. You'd have to have two different versions of your application.
This question has information on detecting a client's runtime version of Silverlight:
Version detection with Silverlight

Related

Is it possible to upgrade a Windows 8.1 App to a UWP Windows 10 app and have WCF project within the UWP app?

I need to upgrade an existing windows 8.1 Mobile app to work on windows 10 and started looking into this.
I have managed to port the code to UWP and it builds and runs the UWP app - so far so good.
However within the app there is a WCF project which is used to go get data and this isn't working.
I am currently getting this error Could not load file or assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Is it even possible for a UWP app to contain a WCF project and this will work?
In the VS2015 solution this all works but in VS2019 it doesn't work as in the ServiceFactory class cant even create an instance.
I have next to no experience of UWP or Windows 8.1 Mobile apps and any advice would be great.
Thanks
Gregor
Note that the WCF Client is actually available for .NET Core/.NET Standard! It's only the server-side part that is not available for .NET Core.
WCF Service: .NET Framework
WCF Client: .NET Standard based (works with .NET Core and .NET Framework)
In your case, if I understand you correctly, you want to call an existing service, which means you need the WCF client, and you can actually use that WCF client with .NET Core/.NET Standard 2.0 and so also with UWP.
Do the following:
Add a new .NET Standard Class Library project to your solution (this will replace the WCF client library that you have already in your solution)
In Solution Explorer, right click on Dependencies and select "Add Connected Service"
This will bring up a page within Visual Studio where you see the "Microsoft WCF Web Service Reference Provider":
Click on it, and the dialog below opens up:
In the dialog above, type in the URL of your service, and the dialog will generate the whole WCF client code for you and it will also add references for the required WCF NuGet packages.
Reference the .NET Standard 2.0 class library project from your UWP project and use it.
Note: WCF-Client in .NET Core does not support the configuration file entries known from .NET Framework projects. That means that the configuration is generated in the C# code.
I hope this helps,
Thomas

Session state service failed- UWP

I am building a UWP application, also i am using desktop bridge which allows the UWP app to launch a win32 application and to communicate with it, to process some data that the UWP app can't give me its result.
The usual behavior of the is that the win32 app is launched for the UWP app, it process the data and then send the response to the UWP app and then it closes.
If for some reason the win32 app opens mutiple times in row, the UWP app crashes(it disappears) when i try to reopen the app, for example while debugging, it takes me to the App.g.i.cs, and say that there is a Session state service failed exception.
For some research i saw that this exception is related to prism, but i explained the behavior above in case it will have any effect on this exception.
Is it possible to know what is the source of this exception so we may able to handle it?

C++ WebView control in Windows Phone 8?

Is there a web browser or web view control available to Windows Phone 8 applications written in C++? I've found a WebBrowser control but that seems to be only available in Windows Phone 7 written in C#.
There's no way to directly use a WebBrowser control in C++. You'll have to create a mixed C++ and XAML projects and overlay the on top of your DirectX .
Note, using Hybrid XAML & D3D apps has a small performance hit over using pure C++ D3D apps. Even if you never show any XAML, just initializing the full CLR and loading up XAML for is still pretty heavy. Read more about it on MSDN here and here.
On other thing that might be applicable to you is that the WebBrowserTask has been ported over to WinRT so it's accessible from C++. Alongside with the Launcher.LaunchUriAsync() method it allows you to navigate away from your app and open up IE10 to a specific page.

Problems with debugging in Silverlight 4 using Out of Browser and WCF RIA Services

With Visual stuido 2010, it's simple to set up SL4 to debug with an out-of-browser installed app. I followed the instructions from here and everything seems to set up fine. Debugging from the browser runs the program just fine, but running from the OOB program gives a different result. After starting, the screen will go blank and then hang forever. I have some concerns that it might be because of some of the technologies that we're using.
Firstly, there's a popup that happens because we're using WCF RIA Services (formerly .NET RIA Services).
"RIA Services will fail unless the silverlight project is hosted and launched from the same web project that contains the RIA Services."
This seems to just be a warning, but I have a suspicion that this warning might be telling me that RIA Services needs to have the .web project as its startup project.
We're also using prism and the error has an odor of a Prism error too. (something loading and then not ever appearing)
Has anyone else had any issues with OOB debugging in SL4? Is anyone else OOB debugging in SL4?
Sorry it's so vague. It's a complicated mess. The only message I see is the italicized popup warning. Then the window (which was previously showing the background of our application) just goes blank
There is currently a known issue with debugging an Out of Browser Silverlight 4 application when using F5 to launch the application from within VS 2010. The question I have is whether or not the application launches without debugging (-F5 or running it from the shortcut)? In the case of using F5, a dialog typically appears with the following error dialog “Unable to start debugging. A fatal error occured. For more details, please see the Microsoft Help and Support web site. HRESULT=0x80070018” and then the application appears to hang. In this case detaching allows the process to continue and then reattaching should allow you to debug the process.
If this is completely blocking or you’re trying to debug code running at startup (like the page startup event), one possible way to get around this would be to put in a call to System.Diagnostics.Debugger.Break, start the program and then attach when dialog pops.
This can be caused by the OOBA install being older than the version you are trying to debug. Remember, Silverlight OOBAs do not automatically update themselves to the latest version of the XAP file that may be available on the server. You have to update them yourself. If you get this error and you have included the auto-update logic in your app, just bounce out of VS, run the app so it auto-updates, then go back in and debug.
Alternately, you can uninstall the app and re-install it. That will ensure you are debugging against the latest VS build.
I ran into this same issue with VS 2008 and Silverlight 3. If I got it, I just jumped out and updated the app then re-ran it in VS and had full debugging.

Suggestions on including the web browser control in VB.Net desktop application

I am writing a desktop app in VB.Net, and I'd like to include a web browser control to automate certain functions the user might have to perform in the browser. I have to render the page so I do not want to use the webrequest to make direct calls. When I publish the app, do I have to be concerned with which version of Internet Explorer the user has on their machine? Are their any third party, freely available, stable web browser controls available for VB.Net that people are using?
You could always ignore the whole IE issue and use the Mozilla engine embedded in your app:
geckofx
"An open-source component for
embedding Mozilla Gecko (Firefox) in
.NET applications."
http://code.google.com/p/geckofx/
Several versions of Visual Studio support web browser controls. Here is an article on how to implement one.
http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx
The web browser control will work with different versions of Internet Explorer, but will be limited to the functionality supported by that version of Internet Explorer.
The article is based on Visual Studio 2008, but in the right corner of the article there are links, on how to use the web browser control, to earlier versions of Visual Studio.
If you embed the Webbrowser control in your application, what you're really doing is embedding a COM object. At runtime, your app will CoCreateInstance() the Webbrowser control, which will load it out of the version of SHDOCVW.DLL or IEFRAME.DLL that is currently on the machine. So, in plain English, you'll be getting the IE6, IE7 or IE8 Webbrowser control, depending on what is installed on the machine.
The practical differences, however, are minimal since the interfaces were published a long time ago and haven't changed over those versions. Differences in terms of different commands that some interfaces (such as IOleCommandTarget) support are abstracted away by the managed layer anyway, so you don't have to worry about that. The biggest difference will be rendering differences, since there is a huge delta in CSS conformance between IE6 and IE8. You'll have to test the various versions using Microsoft's app compat VHDs.
When I worked on the IE team application compatability wrt the Webbrowser control was a huge deal; the team works very hard to make sure that behavior doesn't regress for precisely this scenario—the custom enterprise VB app hosting the WebOC.
Though if you decide to go with an open-source solution to distribute with your app, may I suggest WebKit? Its layout engine is very good and the source code is pretty well maintained and easy to read, though you'll have to write your own managed hosting layer. The Gecko code is much harder to read and debug.