Tuesday, August 31, 2010

Silverlight Error Messages : Could not download the Silverlight Application

When deploying a Silverlight application on IIS you may get a script error: 'Could
not download the Silverlight application'. The cause of this problem is that IIS cannot understand the xap object and it is considered an unknown extesion.

IIS won’t let you access those files on the server. When you installing the Silverlight SDK on your development computer the mime type is installed on your IIS, yet servers without that SDK or the latest version and service packs won’t know about xap.

The solution for this problem is pretty easy.
All what you need to do is to add the MIME type to website properties for .XAP File type(it is application/x-silverlight-app).

So, in MIME Add new :
File name extension : .xap
MIME type : application/x-silverlight-app

Hope it helps all of you,

Happy coding

Tuesday, August 10, 2010

Class MetadataType and property DisplayName

Target : No specific target but I used it when I was working in MVC Project.

Today's issue is not a big deal and did not take any time to resolve ,but I think that it will help too much.
In view I was using html.labelfor and I was binding to GuestResponse model class.

The problem was that the displayed text for the label is the property name and I want another friendly name.

The picture below will display a good details of using a MetadataType attribute of GuestResponse class. This attribute specifies the metadata class to associate with a data model class 'GuestResponse_Metadata' in this class I added a DisplayName attribute.

Why do not I use the DisplayName attribute directly?

My project was complicated more that the sample I am talking about. Data layer was generated by a generation tool and any change will be overriden when regenerating for any reason.

I hope it helps.

Monday, August 9, 2010

.Nettiers problem when changing column type

When using .nettiers I have found a problem of generation when changing column type.
The only way to resolve this problem on my point of view was to select another name for that column.
This change will be a huge problem as sometimes this column is used in stored procedures, functions or buisness layer.
One day I decided to spend a time looking for a solution for this problem.
I tried to change column name and rebuild then change it back, generate and rebuild, but the problem was still existing !!
How it knows the old name ?!!
From the above question I was sure that there is a place that caches it and finally I got it.
Using code smith generation tool that is used for generation there is a mapping file.
When I changing the mapping to a new file map ,then regenerate. The problem solved !!
This mapping file is a config XML file that has all tables definitions and that was the problem :)
Actually I am very happy for resolving this problem and saving a lot of time of chaning column name.

Hope it helps all of you and happy coding ;)

Thursday, August 5, 2010

Reporting Services 2008 and IIS

One of the requirements for SQL Server Reporting Services (SSRS) in the 2000 and 2005 releases was that Microsoft's Internet Information Services (IIS) should be installed on the system as the Web Services product for running the Report Manager and Report Server applications.

I was assuming that will be the case on SQL Server Reporting Services 2008 ,but I figured out that nothing installed on the IIS !!

I thought that someting was wrong ,but after a while I start googling to find out the reason because everything was working well and nothing on IIS !!

YES..
It was a surprise for that when I found that SQL Server Reporting Services 2008 are not more dependent on IIS.

SQL Server 2008 no longer depends on IIS (Andrew Fryer) to make it easier to configure and to reduce the attack surface of the report server.

Config simplification is one of the reasons for the move to not use IIS, but the other is around memory, thread and scale management, if you have every tried to generate a 100 page PDF report you will know what I mean (Evan Garden).

Now in SQL Server Reporting Services 2008, we do not need IIS at all. The Report Manager and Report Server applications can be supported using the HTTP listener (http.sys) that is already part of Windows 2003 Server and above. This is a much more secure architecture. I tested this out on my upgraded test server. I was able to stop my existing IIS service and still run my existing reports successfully(Reporting Services 2008 is IIS Agnostic By Brian Egler).