Tuesday, June 24, 2008

ASP.NET Worker Process

ASP.NET Worker Process

aspnet_wp.exe for Windows 2000

w3wp.exe for Windows 2003.

Wednesday, June 18, 2008

Update Trigger Syntax

CREATE TABLE dbo.foo
(
ID INT IDENTITY (1, 1) PRIMARY KEY NONCLUSTERED
, DomainValue VARCHAR (126) UNIQUE NOT NULL
, DomainType CHAR (1) NOT NULL
, Active BIT DEFAULT 1 NOT NULL
, Created DATETIME DEFAULT GETDATE()
, Modified DATETIME DEFAULT GETDATE() -- TRIGGER
)

GO

CREATE CLUSTERED INDEX cliDomainType ON Foo (DomainType)

GO

CREATE TRIGGER tru_Foo ON dbo.Foo
FOR UPDATE
AS
BEGIN
UPDATE t
SET t.Modified = GETDATE()
FROM Foo AS t
WHERE t.ID =
(
SELECT ID FROM INSERTED
)
END

Scott Guthrie's ASP.NET 2.0 Tips, Tricks, Recipes and Gotchas

http://weblogs.asp.net/scottgu/pages/ASP.NET-2.0-Tips_2C00_-Tricks_2C00_-Recipes-and-Gotchas.aspx

Tuesday, June 17, 2008

Visual Studio 2003 Deployment

Project / Copy Project

Do not use FPS rather use the UI to XCOPY to a local (pre-made) site, only files needed for this project.

NOTE: ANY ERROR IS FATAL TO THE DEPLOYMENT OF THE APPLICATION BUT IT WILL NOT ROLLBACK, IT WILL PARTIALLY DEPLOY. ALWAYS DEPLOY TO A STAGE DIRECTORY (and, of course, test this stage deployed version first) (LOCAL TO TARGET) AND THEN XCOPY OVER.

I discovered this three ways (perhaps because I can be particularly obtuse @ times ...)

1.) Code I rolled did not do what it should ... (Gee, duh ... (and yes, I was staging it))

2.) Funny thing how the VS deployment tool would finish so quickly after encountering an error (i.e. it took 30 seconds when an XCOPY took 2 minutes or more ...)

3.) Hmmm ... My local solution has a rather complex file hierarchy but ... I only see first level hierarchy (and for the immediate sub-levels there are no contents) ... Not sure about the priority/pattern of XCOPY (about which I am guessing the VS 2003 IDE is trying to obfuscate) but ... isn't it funny that if "img21.jpg" & "img22.jpg" (of a second level directory) are there but it bombs (modal) on "img23.jpg" (which it turns out is missing in source but is in VSS manifest) and then "img24.jpg" is not in the subdirectory of the deployed/stage solution (after one hits "OK" on the modal) (but it is in the source directory ...)

Point: Not sure about the exact order of a VS "Copy Project" deployment but if there is an error it is fatal, does not rollback and can leave you with a partial/mixed deployment if you don't stage (use good practices).

Change Source Control Bindings (VSS & Visual Studio 2003)

On Project root, open mssccprj.scc and edit path for project and solution "SCC_Project_Name" values

Force Delete Files, Including System/VSS Bindings

del *.scc /F /S /A S

(& vspscc files)

MetaBase Location

C:\WINDOWS\system32\inetsrv\MetaBase.xml

Monday, June 16, 2008

2003 to 2005 Conversion: "Unable to start debugging on the web server"

Make sure your project did not inherit a port that is configured for 1.1 (i.e. start project properties, web tab, "Use Visual Studio Development Server")

Visual Studio - Just Cannot Get Those Reference Paths Right ...

Given:

C:\Inetpub\dir1.1\resources\foo.dll (i.e. 1.1 version)
and
C:\Inetpub\dir2.0\resources\foo.dll (i.e. 2.0 version)

You want to add the latter (the 2.0 version in dir2.0) to your project references but, after you do so and you go back and check the properties of foo.dll in your project you see that it is pointing to the former (the 1.1 version in dir1).

Check "Project Properties", the "Reference Paths" tab values and remove the paths to any unused directories. These act similarly to path variables and if foo.dll is found in one of them then that is the file that will be used regardless of the fully qualified path that you explicitly specified.

(specific to VS 2005)

Friday, June 13, 2008

Compiler Error Message: CS0006: Metadata file could not be found

Try deleting the c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net files

Access is denied: ‘ICSharpCode.SharpZipLib’.

Turn off (stop) the indexing service

Wednesday, June 11, 2008

ALTER TABLE ADD FOREIGN KEY Syntax

ALTER TABLE bistroProjectTaskRelation
ADD CONSTRAINT fkProject
FOREIGN KEY (projectID)
REFERENCES bistroProject (projectID)

More on Secure Channel Support

Visual Studio 2003 (.Net 1.1)

"Secure Channel Support" errors have occurred quite frequently. Common resolutions have been:

+ (Deployment) use XCOPY, not FPS
+ (IDE) change port, make sure to change definitions in solution file and web.info file (I think this file is specific to 1.1/2003)

Resolution for this instance of the debacle ... one of the eight project files (in the solution) I had converted to 2005 (the only indication being the rather obtuse error). "Secure Channel Support" errors were evident prior to any 2005 conversion efforts and (from what I gather online) have been the bane of many. Discovery of the difference was made with line-by-line analysis of each project manifest file and noting that one of the property value of one of the elements referred to "CodeBehind" versus "Inline", a feature (that if I recall correctly) was fully implemented in 2005 (with the introduction of partial classes).