Silverlight debug problem blank page - silverlight

I have a Visual Studio 2010 and silverlight 4 over it. When I'm trying to run a simple application hello world in a browser, it shows only the blank page.
The type 'Deployment' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
I think the problem is above but how can I solve it?

did you use silverlight with web application? When you create a silverlight app it have one web site associated. On the default.aspx, you have the object. Check the parameters off the object and verify if everything is ok and you have installed all components that support it.

Related

Cannot debug Silverlight application running through VS 2010

I have an start up page called Default.aspx . Have written an javscript function inside the Head tag which opens an other aspx page and closes this page . The other aspx page of mine has silverlight object/ content render on that page . Due to this my debugger doesnt gets attached to the running silverlight application , also when i go to manually attach to the running Silverlight Application it doesnt works , i saw that type of process shown is script / silverlight / x86.
I am doing this all as my login page is only created in silverlight .
Any one have idea how can i get debugger atached.
Edit :
Below link explains the same what i am facing :
Visual Studio Attach to Process - change default automatic code type (Silverlight instead of Script)
To enable Silverlight debugging:
Right click on the Web project hosting the Silverlight application in Solution Explorer
Select "Properties"
Click the "Web" tab
Check the "Silverlight" box in the "Debuggers" section
I had problems debugging Silverlight in Chrome, while in IE it worked like a charm
A very nice utility is the WoVS Default Browser Switcher which can be installed using the Extension Manager (Tools | Extension Manager...)
This tool allows you to set the default browser to be used when debugging your project. In my experience Visual Studio only connects well to IE.
Using the tool I can keep another browser as my default browser but use IE for debugging.
Just use IE as default browser.
It doesn't work properly until you check silver-light debug checkbox and use IE as the others told.
By the way set web application as start-up project.

How to use a Silverlight Solution

I have a Silverlight app made in Visual Studio 2010 and I want to put it on a website but I don't have the slightest clue how.
I've looked at all the msdn documentation and they all mention a .xap file that is the file you use on the website but there is no .xap and I can't find out how to compile my code into a .xap file.
Also, when I run the App and look at the source in the browser, it has my code compiled into the .xap file, but there is no .xap file!
So my question is simply how do you go about getting a Silverlight app on a website because I've been trying for hours and I can't figure it out.
A sample html or aspx page is included when you create the solution. This is the page that the browser navigates to when you hit F5. You can take that page as a basic example of how to embed a Silverlight app in a page. You should find it in the project folder.
Silverlight projects are commonly built into a XAP file when you hit "Build" in VS. This file lives in the bin/Release or bin/Debug folder and basically contains your whole application.
Steps to create a silverlight application Hosted in a web site,
Select Silverlight Application Template while adding new project in VS2010
When you click Ok, ensure that Host the Silverlight application in a new web site is Checked.(It will create a new ASP.Net web application to host the Silverlight)
If you haven't checked the Host the Silverlight application in a new web site option, you can add a new ASP.Net Web application project and then go to its properties and select Silverlight Applications option in left pane. Then Click Add, select your Silverlight Application to be hosted and click ok. You are done now.
But If haven't selected the Silverlight Application Template, then you might have created a Silverlight Class Library. It wont generate any xap file. It just gives a dll. So you need to recreate a project as mentioned above.
I believe that in Silverlight whenever you create a project, right at the beginning, it will ask you if you want to create a web app automatically. If you chose yes, something like YOUR_PROJECT_NAME.web will be created, go into that folder, you will find a folder called ClientBin.
The .xap file will be inside that folder.
HTH

Lync API using PresenceIndicator outputting TypeInitializationException within InitializationCompleted

I am using the Lync API within a WPF application. I have used the Office365 Lync Lab 9.1 within the training kit. However when I move the code into my WPF application the PresenceIndicator or ContactList doesn't work. The controls are displayed however the status of the Lync user is not shown. I am using the exact same accounts that are working within the Office365 Training Lab 9.1.
When I add logging I am shown errors like the following for the PresenceIndicator:
Applying template...
Control 'PresenceIndicator' entering 'OnLoaded'
UCClientInitializationFailed:Failed to Create Provider. Error Type: TypeInitializationException
I am also trying the ContactList and that is outputting:
UCClientInitializationFailed:Failed to Create Provider. Error Type: TypeInitializationException
Also the InitializationError property within the InitializationCompleted event is showing an Unknown error. How would I troubleshoot this issue further?
This is a complete stab in the dark, but are you attempting to add controls to an existing WPF application that has never integrated with Lync before?
It may be that you are missing references in your app - double-check you have references to the following files in %program files%\Microsoft Lync\SDK\Assemblies\Desktop
Microsoft.Lync.Controls.dll
Microsoft.Lync.Controls.Framework.dll
Microsoft.Lync.Model.dll
Microsoft.Lync.Utilities.dll
Microsoft.Office.Uc.dll
Also worth checking:
Is your app builing against .NET Framework 3.5 or 4?
Are you building for AnyCPU?
If that doesn't help, you could try creating a new WPF application using the "Lync WPF Application" template in Visual Studio. If this works correctly, then compare this against your appplication for any differences in references, configuration etc.
This MSDN page may be useful.

Debug Silverlight component from MVC application Visual Studio 2010

In my solution I have a MVC project. Then I added a Silverlight project. When I added the Silverlight project, I set to include it in the existing web application (MVC project).
It added an .aspx page that contains the Silverlight component. The problem is that I cannot debug into the Silverlight code when I start the ASP.NET MVC application. I set a breakpoint in the Application_Startup function in the Silverlight code, but it never stops there. On the breakpoint I have a tooltip:
The breakpoint will not currently be hit. No symbols have been loaded for this document
How do I fix this problem?
Which browser are you using? I've had mixed results with debugging Silverlight with anything besides Internet Explorer, so I'm making sure to use Internet Explorer when developing Silverlight applications.
If you're using Internet Explorer, then Evan's solution should work (at least that's what has stopped me some time - Silverlight debugging disabled in the web project).
Also check that your Silverlight application is present in the list located under Web project properties > Silverlight Applications.
I found the problem. The browser was caching the Silverlight application. I solved that with the following code when initializing the Silverlight component:
param name="source" value="ClientBin/form.xap?<%= DateTime.Now.Ticks %>"

VS2010 Code: 2104 Could not download the Silverlight application

I've just started getting this Javascript error running VS2010 with SL4
Error: Unhandled Error in Silverlight Application
Code: 2104
Category: InitializeError
Message: Could not download the Silverlight application. Check web server settings
Everything was working fine, changed 1 line of code to use a RegularExpression in the web project (using the Silverlight Business Application template) then when rebuilding I get this error.
Google says this is IIS and mimetype related. I'm using Cassini not IIS with VS2010.
Rebooted, cleared xap from IE cache. Error on both IE and FF.
What could be wrong?
I just got this error myself. Looking at source control and my project I noticed that the original test pages that were created when I setup the project got replaced by two new test pages (one .aspx and one .html).
I removed the newly created pages and went back to the old test pages and things started working.
If your situation isn't the same as mine, then just check your silverlightControlHost div in your test page and make sure you are pointing to the correct .xap file and runtime.
if youre not running in IIS then just check your silverlightControlHost div in your test page and make sure you are pointing to the correct .xap file and runtime.
If you were in MVC you could do something similar...
<param name="source" value="#Url.Content("~/ClientBin/NameOfYourSlAppGoesHere.xap")" />
Follow the Step :
On Hosting project, Properties > Silverlight Applications > Add..
This solved my Problem.
Simple error.
I had the same error with my provider. When I looked at the MIME type everything seemed to be OK:
.xap => application/x-silverlight-app
which seems to be the default value on IIS 6. Then I looked at the webpage VS 2010 created and noticed that it has a MIME type of
application/x-silverlight-2
I changed the MIME type on IIS according to the webpage's type and - my silverlight application gets loaded without any error!
This error often occurs because the MIME type is not set, as you have found for yourself. It can also be a mask for the HTTP error. You can see the message by pulling up the XAP file directly from your browser (http://yourwebsite/ClientBin/filename.xap). The file will either attempt to download, or it will show you an HTTP Error.
I also had the same issue on VS 2010. And the reason was that the .xap file was not getting copied to ClientBin directory of the hosting web site project.
Reason was the association from the hosting web site project to the silverlight project was missing for some reason. (should be due to some restructuring of the projects that I've done recently in my case)
I had to re-add the association from the hosting web site project to the silverlight project.
Steps:
On Hosting project, Properties > Silverlight Applications > Add..
I faced a similar issue and it was solved with the help of this blog post: http://vanderbiest.org/blog/2009/10/27/2104-silverlight-initialization-error/
Just ensuring that IIS_IUSRS has read and read & execute permission on the XAP file might fix this issue.
.xap file was not getting copied to ClientBin directory
The problem in my case was that http://mysite/ClientBin/MyApp.xap was returning a 404. The build process was copying the XAP file into /ClientBin/DEBUG/ - I expect this is because someone told it to copy the XAP file to a config specific folder. To fix it I did the following...
Go to the properties of your website.
Go to the Silverlight Apps page.
If your Silverlight app is already referenced there, remove it.
Now click Add.
Select your existing SL app.
Make sure "Copy to a config specific folder" is NOT checked!
for my case it occured In IE and in chrom the project work.
it resolved by
disable protected mode in IE.(Internet Option -->Security)
For my case (with visual studio 2012), one of the projects in the solution wasn't loaded...
right click->reload project.
fixed.

Resources