VS2010 Code: 2104 Could not download the Silverlight application - silverlight

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.

Related

DNN Error after creating a module

I was given a project for maintenance, it is built on DNN 9.1.1 and has some custom modules (I am completely new to DNN). I needed to create a new module, so I used the christoc project templates for VS2017. So even before I could develop anything, I rebuilt the solution and it gave me a DNN Error. I removed the project from the solution, but while it compiles correctly, it still gives the same error.
Has anyone ever got this error? Do you think the module are being written to the database and if so, how can I delete it?
I'm posting the errors in the log but it doesn't make sense to me, because no files are missing
DotNetNuke.Services.Exceptions.Exceptions - DotNetNuke.Services.Exceptions.PageLoadException: Unhandled error loading page. ---> System.Web.HttpParseException: The file '/DesktopModules/GFIPortugal/DotNetNuke.Search.Google/GoogleSearch.ascx' does not exist. ---> System.Web.HttpParseException: The file '/DesktopModules/GFIPortugal/DotNetNuke.Search.Google/GoogleSearch.ascx' does not exist. ---> System.Web.HttpException: The file '/DesktopModules/GFIPortugal/DotNetNuke.Search.Google/GoogleSearch.ascx' does not exist.
Thanks in advance for your help.
I found that this is a common error. Funny how it was so hard to find on google. I leave the link here https://www.christoc.com/Tutorials/All-Tutorials/aid/12, and urge everyone with template errors to refer to this site.
In plain, the solution is this:
Load the IIS Manager (start>run>inetmgr.exe)
Expand the Tree view on the left side of the screen until you see the SITES folder
Expand the Sites folder until you find your development site
Expand your development site (DNNDEV.ME) until you see the DesktopModules folder
If the DesktopModules folder has an "arrow" on it, IIS thinks it is a virtual directory, and this is what causes the error above. Right click on the DesktopModules folder, choose Delete.
Reload the site in your web browser, and the error should go away. Do not simply refresh the browser, as the error is in the URL and will likely just reload the error page even though you've fixed the problem
Does the .ascx control exist in the correct path?
'/DesktopModules/GFIPortugal/DotNetNuke.Search.Google/GoogleSearch.ascx'
Maybe you have created an extra subfolder.
try like this:
'/DesktopModules/GFIPortugal/GoogleSearch.ascx'
When you add a new module via Visual Studio unselect the option to create a folder for your project/solution (bottom right of the Add New Project wizard).
Also, check the .dnn file to adjust the mappings of your resources.

Custom fonts not getting uploaded in Openshift server

I have developed an application which uses custom CSS3 fonts. But somehow custom fonts are not getting uploaded in the server. My application URL is http://techcurt-kshitiz.rhcloud.com and when I try to access custom font like http://techcurt-kshitiz.rhcloud.com/resources/css/LindenHill-webfont.eot, The requested resource is not available appears. Custom fonts are working fine in my local machine in every browser.
I have recreated my application but still the problem persists. I have been using Openshift since an year but never faced such issue. What can be the possible reason for it? Even .less file is not getting uploaded. I am using tomcat 6 server in Openshift. I am not able to find out any solution in Google.
Do you see the files on disk when you SSH to the gear?
Are the files checked into Git? It's possible that they are being ignored by git, and hence not uploaded. You can check that the file is in git with "git show master:" - if ignored it won't show up.
Otherwise, it could be something in your build - perhaps the files are getting deleted?
Finally my issue is solved by servlet-mapping .ttf and .eot files in my web.xml files. But I am not able to understand how come my application was running in local machine but not in server? How come thats possible?

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

How can I reference resx files in a Silverlight RIA Services Library? [duplicate]

I'm working on a Silverlight project with the WCF RIA Services beta. I'm using the BlahDomainService.metadata.cs file to validate a field by adding validation attributes, e.g. [RegularExpression]. It was working so I'm trying to put the Error message in a resource file and now it isn't working. The RegEx validation isn't being run on the client, though it is being run on the server.
Any idea what might be causing this?
In the generated code file on the client, I see this error:
// Unable to generate the following attribute due to the following error(s):
//
// - The validation attribute 'System.ComponentModel.DataAnnotations.RegularExpressionAttribute' declared ErrorMessageResourceName='RegExError' which was not found on declared ErrorMessageResourceType 'Blah.Web.Resources.SharedResources'.
// [RegularExpressionAttribute("yawn", ErrorMessageResourceName = "RegExError", ErrorMessageResourceType = typeof(Blah.Web.Resources.SharedResources))]
How I got where I am
I created the SharedResources.resx (and Vs created SharedResources.Designer.cs) file in the .Web project in a folder called Resources. In the Silverlight project, I created a Web folder and in that a Resources folder. To this Resources folder, I did Add > Existing Item and then added the SharedResources.resx and .Designer.cs using the Add as Link option. The idea was that this would keep the namespaces the same for the two resources classes. I then edited the .csproj file to make the .Designer.cs file a dependency of the .resx file, using the Silverlight Business Application template as a reference.
I built the solution and tested it and the RegEx validation throws no error, which is bad. Then I found the message above. To verify that my linking was working, in Home.xaml.cs, I typed:
System.Diagnostics.Debug.WriteLine(Web.Resources.SharedResources.RegExError);
and saw the error in the Output window in VS. I also submitted the changes to the service and in the EntitiesInError, on the VaidationErrors, I can see the error message, so I know it's working server-side. It's just the client-side that isn't. Any idea why it's not working?
You also have add a resources (.resx) as a link in the client silverlight project for the web project.
See template Silverlight Bussiness Application in VS 2010. It has a very good sample.
Everything was okay except that I hadn't set the AccessModifier for the .resx to Public. Once I'd done that and Rebuilt All, it worked.

Why isn't my shared resource file working in my Silverlight RIA project?

I'm working on a Silverlight project with the WCF RIA Services beta. I'm using the BlahDomainService.metadata.cs file to validate a field by adding validation attributes, e.g. [RegularExpression]. It was working so I'm trying to put the Error message in a resource file and now it isn't working. The RegEx validation isn't being run on the client, though it is being run on the server.
Any idea what might be causing this?
In the generated code file on the client, I see this error:
// Unable to generate the following attribute due to the following error(s):
//
// - The validation attribute 'System.ComponentModel.DataAnnotations.RegularExpressionAttribute' declared ErrorMessageResourceName='RegExError' which was not found on declared ErrorMessageResourceType 'Blah.Web.Resources.SharedResources'.
// [RegularExpressionAttribute("yawn", ErrorMessageResourceName = "RegExError", ErrorMessageResourceType = typeof(Blah.Web.Resources.SharedResources))]
How I got where I am
I created the SharedResources.resx (and Vs created SharedResources.Designer.cs) file in the .Web project in a folder called Resources. In the Silverlight project, I created a Web folder and in that a Resources folder. To this Resources folder, I did Add > Existing Item and then added the SharedResources.resx and .Designer.cs using the Add as Link option. The idea was that this would keep the namespaces the same for the two resources classes. I then edited the .csproj file to make the .Designer.cs file a dependency of the .resx file, using the Silverlight Business Application template as a reference.
I built the solution and tested it and the RegEx validation throws no error, which is bad. Then I found the message above. To verify that my linking was working, in Home.xaml.cs, I typed:
System.Diagnostics.Debug.WriteLine(Web.Resources.SharedResources.RegExError);
and saw the error in the Output window in VS. I also submitted the changes to the service and in the EntitiesInError, on the VaidationErrors, I can see the error message, so I know it's working server-side. It's just the client-side that isn't. Any idea why it's not working?
You also have add a resources (.resx) as a link in the client silverlight project for the web project.
See template Silverlight Bussiness Application in VS 2010. It has a very good sample.
Everything was okay except that I hadn't set the AccessModifier for the .resx to Public. Once I'd done that and Rebuilt All, it worked.

Resources