Alexandre
Alexandre

Reputation: 13318

How to check via web if .NET Framework4 Client is installed

Is it possible to check via web site if end use has installed .NET Framework4 Client ? It's desirable if this way doesn't use any plugins (flash or silverlight).

Upvotes: 0

Views: 213

Answers (1)

casperOne
casperOne

Reputation: 74560

From the server side, the best you can do is sniff the user agent that is sent with the request to the website. In it you'll usually see something along the lines of:

.NET <version number>

Or something to that effect.

Of course, there are major drawbacks to this (as there is with any user agent detection) which warrant not doing this:

  • The user agent can be spoofed
  • Parsing strings that are not structured is generally error-prone
  • Not all browsers (i.e. non-IE browsers) are obligated to send this information

That said, ChrisF's comment asking why is somewhat relevant, in the sense that you are better off having code execute on the client side to detect this, as there are more definitive ways (checking the registry) of determining if .NET 4.0 is installed on the client, using mechanisms that you just don't have available to you from the server side.

The thing is, if the code is served up from the server side, then it will probably be sandboxed in some way, and you'll have to figure out a way to access the registry (which is typically restricted in most sandboxes for code downloaded from the web).

Upvotes: 2

Related Questions