Thursday, January 3, 2013

turn on ASP.NET 4.0

This and this has a good article on how to beat this error when running a web site in Visual Studio via IIS:

ASP.NET 4.0 has not been registered on the Web server. You need to manually configure your Web server for ASP.NET 4.0 in order for your site to run correctly, Press F1 for more details.

  • Try to turn on everything when prepping IIS7 except for "IIS6 Management Console"
  • Open a command prompt as an administrator and type:
    aspnet_regiis.exe -i
    ...at:
    C:\Windows\Microsoft.NET\Framework\v4.0.30319\

DirectCast in VB allows for downcasting!

The last line of C# code here will cause an error:

Cat cat = new Cat();
Lynx lynx = new Lynx();
Cat attemptedUpcast = (Cat) lynx;
Lynx attemptedDowncast = (Lynx) cat;

Share photos on twitter with Twitpic

 
 

But none of the following lines of VB Script are problematic:

Partial Class VBform
   Inherits System.Web.UI.Page
   Dim snake As Snake
   Dim viper As Viper
   Dim attemptedUpcasting As Snake = CType(viper, Snake)
   Dim attemptedDowncasting As Viper = DirectCast(snake, Viper)
End Class

Share photos on twitter with Twitpic

put a user in a group

Share photos on twitter with Twitpic

see also: http://tom-jaeschke.blogspot.com/2012/12/create-users-for-iis7-in-windows7.html

to change the Application Pool for a web site in IIS...

...select the web site in IIS and then click on "Advanced Settings..." ...The application pool will, amongst other things, dictate what version of the .NET framework a site runs within

Share photos on twitter with Twitpic

older App Pool notes:

  1. http://tom-jaeschke.blogspot.com/2012/06/iis7-notes.html
  2. http://tom-jaeschke.blogspot.com/2012/12/change-framework-version-of-aspnet-for.html

Wednesday, January 2, 2013

Option Explicit On

...at the top of a file in VB Script asserts that, in the code to come, one must use the Dim keyword when declaring variables.

Use CLR assemblies in SQL!

  1. See the assemblies Object Explorer at: Your Server > Databases > Your Database > Programmability > Assemblies
  2. This is an example of calling the assemblies from SQL like so:
    WITH EXECUTE AS CALLER
    AS
    EXTERNAL NAME [NameOfAssembly].[NameOfClassWithinAssembly].
       [NameOfMethodWithinClass]
    GO

What Linked Servers does your server recognize?

  1. Connect to your server in MSSQL Management Studio 2008.
  2. In the Object Explorer go to: Your Server > Server Objects > Linked Servers