.NIT

Friday, December 17, 2004

PRB: Configured Identity Is Incorrect for IWAM Account

PRB: Configured Identity Is Incorrect for IWAM Account

Tuesday, December 14, 2004

GetIpValue

private Int64 GetIPValue(string ip)
{
string[] parts;
parts = ip.Split('.');
if(parts.Length != 4)
throw new ApplicationException("Invalid IP Address");

return Convert.ToInt64(parts[0]) * 16777216 + Convert.ToInt64(parts[1]) * 65536 + Convert.ToInt64(parts[2]) * 256 + Convert.ToInt64(parts[3]);
}

Monday, December 13, 2004

Deploy specific Web.config file

I'll assume you have WebRelease and WebDebug files as outlined below.

1) Set the "Build Action" property for those two files to "None"
2) Open the Macro Editor
3) Add a new Macro
4) Insert this code:
Sub SetConfigOverRides()
Const ProjName As String = "WebApplicationCS1"

Dim proj As EnvDTE.Project
Dim i

'Find the project
For i = 1 To DTE.Solution.Projects.Count
If DTE.Solution.Projects.Item(i).Name.ToLower = ProjName.ToLower
Then
proj = DTE.Solution.Projects.Item(i)
Exit For
End If
Next

If Not proj Is Nothing Then
For i = 1 To proj.ConfigurationManager.Count
Select Case
proj.ConfigurationManager.Item(i).ConfigurationName.ToLower
Case "debug"

proj.ConfigurationManager.Item(i).Properties.Item("ConfigurationOverrideFile
").Value = "WebDebug.Config"
Case "release"

proj.ConfigurationManager.Item(i).Properties.Item("ConfigurationOverrideFile
").Value = "WebRelease.Config"
End Select
Next
MsgBox("Done Overriding Configuration dependent Web.Config
Files")
Else
MsgBox("Couldn't Find the Project Named: " & ProjName)
End If


End Sub

5) Modify the Code
a) change the Const ProjName value to be your project name
b) add any Configurations you want to the Select Case statement (I only
did Debug and Release)

6) Save and run the Macor
7) Save your C# project file.

You should only have to do this once to inject the values into the project
file. We are using the Macro to use "extensibility" to update values in the
C# project, since C# does not expose this feature in the UI.