by Mark Shiffer
29. September 2007 01:29
The IISApp command is a handy tool that when run from the command line will display the process IDs for applications pools running in IIS. Very useful when you are attempting to attach a debugger to the process.
by Mark Shiffer
26. September 2007 23:38
Today I was attempting to install version 3 of the .NET framework on a Windows XP SP2 machine. I had a heck of a time trying to get this to install. I thought I would run through my steps in case anyone else (or myself later on) could find it useful (all of the failed logs are attached):
-
Attempted to install framework via .NET 3 download from Microsoft
-
The install logged 3 files: VSSWMSIFailInfo.txt (not helpful), VSSWMSIInstallTime.txt (not helpful), VSSWMSISummayr.txt
-
In the summary file I noticed that it said "Windows Communication Foundation -- Installation failed"
-
I happened to find reference in some forums to wcf installation logs being stored in C:\Documents and Settings\[User]\Local Settings\Temp\dd_wcf_retMSI34B1.txt
-
So that told me that the installation of WCF was failing, but all it was giving was a general 1603 error.
-
-
Next I looked at the event log to see what was there. A long list of warnings accompanied by an error were happening during the install:
-
System.InvalidCastException: Specified cast is not valid.
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Management.ManagementScope.InitializeGuts(Object o)
at System.Management.ManagementScope.Initialize()
at System.Management.ManagementScope.Connect()
at System.ServiceModel.Install.WmiInstallComponent.get_IsInstalled()
at System.ServiceModel.Install.WmiInstallComponent.ApplyNamespaceDacl(OutputLevel outputLevel)
at System.ServiceModel.Install.WmiInstallComponent.OnInstall(OutputLevel outputLevel)
at System.ServiceModel.Install.WmiInstallComponent.Reinstall(OutputLevel outputLevel)
at Microsoft.Tools.ServiceModel.ServiceModelReg.PerformAction(ActionItem actionItem, Nullable`1 confirmUninstall)
at Microsoft.Tools.ServiceModel.ServiceModelReg.Run(String[] args)
at Microsoft.Tools.ServiceModel.ServiceModelReg.TryRun(String[] args)
-
Failure executing "C:\WINNT\system32\wbem\mofcomp.exe" with parameters ""C:\WINNT\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModel.mof"": System.ApplicationException: Unexpected result 3 executing C:\WINNT\system32\wbem\mofcomp.exe with "C:\WINNT\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModel.mof"
at System.ServiceModel.Install.InstallHelper.ExecuteWait(String program, String parameters, Int32[] allowedExitCodes)
at System.ServiceModel.Install.WmiInstallComponent.OnInstall(OutputLevel outputLevel)
-
A TransportConfiguration node does not exists in the system.web section for protocol msmq.formatname in C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Config\web.config.
-
A Protocol node does not exists in the system.web section for protocol msmq.formatname in C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Config\web.config.
-
HttpModules node ServiceModel does not exist in System.Web section group.
-
HttpHandlers node *.svc does not exist in System.Web section group
-
All compilation assembly nodes do not exist in System.Web section group.
-
A configuration entry for BuildProvider System.ServiceModel.Activation.ServiceBuildProvider, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 does not exist.
-
Configuration section system.serviceModel.activation does not exist in C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Config\machine.config.
-
Configuration section system.runtime.serialization does not exist in C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Config\machine.config.
-
Configuration section system.serviceModel does not exist in C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Config\machine.config.
-
-
This gave me a list of errors:
-
Missing: C:\WINNT\System32\WBEM\wbemsvc.dll
-
WMI MONIKER CONNECTION errors occured for the following namespaces: Root, 0x1AE - Class doesn't support Automation.
-
WMI CONNECTION errors occured for the following namespaces: Root, 0x80004002 - No such interface supported.
-
I copied the wbemsvc.dll from another computer that was running fine, restarted the WMI service and reran the installation. This time it worked!
I have attached a zip file containing the diagnostic tool and all of my original log files for reference. I hope this helps others who are struggling with this.
FrameworkInstallErrors.zip (1.17 mb)
by Mark Shiffer
24. September 2007 22:31
I read a pretty good article in MSDN Magazine detailing 9 patterns from multi-threaded programming. There are a lot of details about MTA that elude many of today's programmers, and even .NET in all of its bliss has not completely hidden the complexities involved. The patterns described are: Countdown Latch, Reusable Spin Wait, Barriers, Blocking Queue, Bounded Buffer, Thin Event, Lock-Free LIFO Stack, Loop Tiling and Parallel Reductions. The article also goes into details about performance of the various alternative methods used in MTA, such as, Interlocked.Increment, Interlocked.Decrement, Interlocked.CompareExchange, Thread.SpinWait, EventWaitHandle.Set, EventWaitHandle.Reset, Monitor.Pulse, Monitor.Wait, Monitor.PulseAll, Thread.MemoryBarrier, ManualResetEvent.
The article can be found at: 9 Reusable Parallel Data Structures and Algorithms
by Mark Shiffer
21. September 2007 01:46
I recently ran into some issue when attempting to transmit large files as a response to an ASP.NET request. My App was set up with the following standard code:
Response.AddHeader("Content-Length", info.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment;filename=" + info.Name);
Response.WriteFile(path);
It turns out that WriteFile causes the server to attempt to buffer the response, and with a large file this just makes the server sit and time out with no useful error message being returned. I first got thrown off and attempted to increase buffer limits in IIS (defaulted to 4MB), but that did not help the issue. I then found Response.TransmitFile which does not buffer the response. So far, Response.TransmitFile appears to have fixed the issue. The files in question were 75MB to 100MB a piece. I had tested and 20MB files were able to make it through with the original code (odd with IIS's default limit being 4MB). So, I am not certain where the cutoff is, and what, if any, setting would allow Response.WriteFile to function for larger files.
Another odd part about this error was that when running locally in debug mode in VS, I had no problems. The file was still located on a network server. However, when the application was run from the server the error occurred.
by Mark Shiffer
14. September 2007 02:14
-
Reformat Code: CTL-K, CTL-D reformats code
-
Collapse Code Sections: CTL-M, CTL-O
-
Surrond selection with...: CTL-K, CTL-S (helpful in creating code regions)
|
Visual Studio 2008 Hot Keys (poster)
Edit
|
| Edit.CollapseTo-Definitions |
CTRL + M, O |
| Edit.ToggleAllOutlining |
CTRL + M, L |
| Edit.ToggleOutliningExpansion |
CTRL + M, M |
| Edit.StopOutlining |
CTRL + M, P |
| Edit.CommentSelection |
CTRL + K, C or CTRL + E, C |
| Edit.UncommentSelection |
CTRL + K, U or CTRL + E, U |
| Edit.FormatDocument |
CTRL + K, D or CTRL + E, D |
| Edit.FormatSelection |
CTRL + K, F or CTRL + E, F |
| Edit.InsertSnippet |
CTRL + K, X |
| Edit.SurroundWith |
CTRL + K, S |
| Edit.InvokeSnippetFromShortcut |
TAB |
| Edit.CycleClipboardRing |
CTRL + SHIFT + V |
| Edit.Replace |
CTRL + H |
| Edit.ReplaceInFiles |
CTRL + SHIFT + H |
| View.ShowSmartTag |
CTRL + . Or SHIFT + ALT + F10 |
| File |
| File.NewProject |
CTRL + SHIFT + N |
| File.OpenProject |
CTRL + SHIFT + O |
| Project.AddClass |
SHIFT + ALT + C |
| Project.AddExistingItem |
SHIFT + ALT + A |
| Project.AddNewItem |
CTRL + SHIFT + A |
| Window.ShowEzMDIFileList |
CTRL + ALT + DOWN ARROW |
| Edit.OpenFile |
CTRL + O |
| Intellisense |
| Edit.CompleteWord |
CTRL + SPACE or CTRL + K, W |
| Edit.ListMembers |
CTRL + J or CTRL + K, L |
| Edit.QuickInfo |
CTRL + K, I |
| Edit.ParameterInfo |
CTRL + SHIFT + SPACE or CTRL K, P |
| Make Completion List Transparent |
CTRL |
| Navigation |
| Edit.FindAllReferences |
SHIFT + F12 or CTRL + K, R |
| Edit.GoToBrace |
CTRL + ] |
| Edit.GoToDefinition |
F12 |
| Edit.GoToNextLocation |
F8 |
| Edit.IncrementalSearch |
CTRL + I |
| View.ClassViewGo-ToSearch, Combo |
CTRL + K, CTRL + V |
| View.ForwardBrowseContext |
CTRL + SHIFT + 7 |
| View.PopBrowseContext |
CTRL + SHIFT + 8 |
| View.NavigateBackward |
CTRL + MINUS SIGN (-) |
| View.NavigateForward |
CTRL + SHIFT + MINUS SIGN (-) |
| Edit.FindInFiles |
CTRL + SHIFT + F |
| Edit.FindSymbol |
ALT + F12 |
| View.ViewCode |
F7 |
| View.ViewDesigner |
SHIFT + F7 |
| View.ViewMarkup |
SHIFT + F7 |
| Window.MoveToNavigationBar |
CTRL + F2 |
| Edit.Find |
CTRL + F |
| Edit.GoTo |
CTRL + G |
| Edit.GoToFindCombo |
CTRL + / |
| Window |
| View.ClassView |
CTRL + W, C |
| View.CodeDefinitionWindow |
CTRL + W, D |
| View.Command-Window |
CTRL + W, A |
| View.ErrorList |
CTRL + W, E |
| View.ObjectBrowser |
CTRL + W, J |
| View.Output |
CTRL + W, O |
| View.PropertiesWindow |
CTRL + W, P |
| View.SolutionExplorer |
CTRL + W, S |
| View.TaskList |
CTRL + W, T |
| View.Toolbox |
CTRL + W, X |
| View.ServerExplorer |
CTRL + W, L |
| Window.CloseToolWindow |
SHIFT + ESC |
| Data.ShowDataSources |
SHIFT + ALT + D |
| Window.CloseDocument, Window |
CTRL + F4 |
| Window.NextDocument, WindowNav |
CTRL + TAB |
| Refactor |
| Refactor.EncapsulateField |
CTRL + R, E |
| Refactor.ExtractInterface |
CTRL + R, I |
| Refactor.ExtractMethod |
CTRL + R, M |
| Refactor.PromoteLocalVariabletoParameter |
CTRL + R, P |
| Refactor.RemoveParameters |
CTRL + R, V |
| Refactor.Rename |
CTRL + R, R or F2 |
| Refactor.ReorderParameters |
CTRL + R, O |
| Debugging |
| Debug.Autos |
CTRL + D, A |
| Debug.CallStack |
CTRL + D, C |
| Debug.Immediate |
CTRL + D, I |
| Debug.Locals |
CTRL + D, L |
| Debug.QuickWatch |
CTRL + D, Q |
| Debug.Start |
F5 |
| Debug.StartWithoutDebugging |
CTRL + F5 |
| Debug.StepInto |
F11 |
| Debug.StepOut |
SHIFT + F11 |
| Debug.StepOver |
F10 |
| Debug.StopDebugging |
SHIFT + F5 |
| Debug.ToggleBreakpoint |
F9 |
| Debug.Watch |
CTRL + D, W |
| Debug.EnableBreakpoint |
CTRL + F9 |
| Make Datatip Transparent |
[CTRL] |
| Build |
| Build.BuildSolution |
F6 or CTRL + SHIFT + B |
| Build.BuildSelection |
SHIFT + F6 |
by Mark Shiffer
14. September 2007 00:16
- Move cursor to search box : CTL-E
- Add www/com to address: CTL-Enter
by Mark Shiffer
14. September 2007 00:13
- Run Dialog: Windows Key + R
- Run Quick Launch Application: Windows Key + # (Windows Vista Only)
by Mark Shiffer
13. September 2007 22:10
Handy tool for IE. IE7 Open Last Closed Tab is a plug-in for Internet Explorer 7 that makes "Alt-X" reopens the last closed tab. This is very useful when you accidentally close a tab that you didn't mean to close. Instead of trying to find it in your browser history, you hit "Alt-X" and it automatically reopens in a new tab. It also supports a Quick Tab Style View, shown when you hit "Alt-Q", which gives you thumbnails of the previous tabs you've closed (like the built-in IE Quick Tabs, but for previously closed tabs).
http://www.windowsmarketplace.com/details.aspx?view=info&itemid=3119163
by Mark Shiffer
13. September 2007 20:17
I ran across a website that attempts to do a mash-up of the various social networking sites out there to provide one place to search for people. www.spock.com From what I can tell they heavily use both LinkedIn (a professional network) and MySpace (a social network) to gather their data. There is obviously a lot of repetition in their results, but if you are looking for someone and have some clue as to where they might be or have been, this search could be useful in tracking them down. You can search on just about anything that might be in their profiles on the various sites, so that opens it up to various search angles.
From a technical viewpoint, this probably was not very difficult to pull off. A little screen-scraping and your done.
by Mark Shiffer
13. September 2007 19:14
I have not checked this one out yet, but I read an article in PC Mag where it was metioned. It is free and appears to have a good deal of audio/video conversion formatting utilities.