Remove .pdb path from exe in Microsoft Visual Studio 2010

If you look at executables shipped from Microsoft like notepad.exe, you will see that they include .pdb (Program Database) reference, but do not include path to .pdb:
notepad.pdbvs
d:\some\dir\release\bin\etc\notepad.pdb

This path can sometimes reveal unnecessary information to your customer / user, so if you want to get rid of that path in Visual Studio 2008, you could use undocumented switch:
/pdbpath:none

In Visual Studio 2010 (c++) you can use documented switch:
/PDBALTPATH:%_PDB%

Reference: Visual Studio 2010 – Visual C++ – /PDBALTPATH

Unfortunately, I can not find a such option for .net / C# executables. The only option it seems is /pdb switch, but it is not accessible from IDE.

P.S. To view .pdb reference within exe file, use Hex Editor or dumpbin utility
dumpbin /headers notepad.exe

Run as administrator missing for shortcuts created by Visual Studio Setup Project

When Visual Studio 2008 / 2010 creates Setup and Deployment project (Visual Studio Installer), it misses one important feature – ‘Run as administrator’ that is available form context menu (right mouse click) for shortcuts created on Desktop and in Start menu (under Windows Vista and Windows 7).

To get normal shortcuts you need to edit MSI file’s Shortcut Table using orca.exe tool.

Orca.exe is a database table editor for creating and editing Windows Installer packages and merge modules. The tool provides a graphical interface for validation, highlighting the particular entries where validation errors or warnings occur.

This tool is only available in the Windows SDK Components for Windows Installer Developers. It is provided as an Orca.msi file. After installing the Windows SDK Components for Windows Installer Developers, double click Orca.msi to install the Orca.exe file.

Source: msdn.microsoft.com

After installing, launch it form Start menu.

One discussion at microsoft.public.vstudio.general talks about the following scenario:
1) Examine your File table to see what the key is for the program you want to give a standard shortcut. Let's say the key is "myprog.exe".

2) Open the Shortcut table for your install and locate the shortcut entry you want to change.

3) Replace the Target value with "[#myprog.exe]". The brackets and pound sign are a Formatted string that tells WI to create a standard shortcut to the file.

But it does not work for me. My setup msi creates no shortcut at all.

Other forums talks about another approach, changing DefaultFeature to [TargetDir]\your_exe_file.exe, but that creates shortcut that links to root of system drive (c:\), not the actual target folder.

Later, checking Directory Table I noticed that I have TARGETDIR instead of TargetDir, so I changed DefaultFeature to [TARGETDIR]\your_exe_file.exe, and it now shows Run as administrator in context menu.

Update: I have figured out that [#myprog.exe] didn’t work because it should point to Key from File Table, and key is not always exe name. Have not tested this yet.

This is according to msdn.microsoft.com:
If a substring of the form [#filekey] is found, it is replaced by the full path of the file, with the value filekey used as a key into the File table.

Things that will make your website much faster

What will make my website faster? How to optimize page load time? How to make web site appear to load faster for end user?

Updated Feb 9, 2011.

This is excerpt from article: How big HTML images / CSS / JS / png / etc. should be to fit network packet (MTU) efficiently

List of things that will make your website much faster:

  • Server must support Keep-Alive. Otherwise change server / host / hosting company / etc. Do it NOW!
  • Reduce HTTP requests (CSS sprites, combine CSS, combine JS, inline CSS, inline JS)
  • Minifiy HTML, JS, CSS. Google Closure Tools, YUI Compressor, Minification
  • Gzip text/html, css, js (IE6 does not un-gzip CSS and JS, if reference is not from HEAD)
  • For IE 5 & 6 use gzip-only-text/html
  • Check if (Content-Encoding: gzip) then (Vary: Accept-Encoding) to allow cache both versions in proxy servers
  • CSS goes in head, JS goes at bottom – right before body closing tag
  • Defer JS if possible. Defer allows to load js after onload
  • Image formats: for photos – always use JPG, for everything else – PNG 8, for animations – GIF
  • Compress images: for JPG use jpegtran or jpegoptim Adobe Photoshop or Advanced JPEG Compressor (both non-free) or free GIMP, for PNG use OptiPNG or PNGOUT. I use non-free but the best one – PNGOUTWin
  • Think connections! Waterfall. webpagetest.org (probably the best site for web page speed / optimization test), Zoompf (a little overkill, but can be useful), Pingdom Tools
  • Try to serve assets in parallel, e.g, images.example.com, images2.example.com; subdomains can be on the same IP
  • Use 2-3 max 4 sub-domains
  • Optimize response headers, smaller, meaningful
  • Avoid redirects (301, 302, META refresh, document.location)
  • Remove ETAG
  • Use Expires + cache-control
  • 25k and greater files are not cached on iPhone
  • Cache dynamic content PHP, ASPX, ruby etc.
  • example.com?param is not cached by most proxies
  • Serve static assets from cookie-less domain, like yimg.yahoo.com
  • After onload via js can pre-cache images (if you know where visitor will go next)
  • Can use double heads (if a lot of meta then put 2nd head at the bottom after closing BODY tag)
  • Use CDN if can afford

And remember about:

Related tools / links:

More reading and watching:

While making website faster, do not forget about security:

Things that big guys (such as Google, Microsoft, Yahoo, Akamai) do. This requires custom software, customized Linux / BSD / Apache compilation, and of course deep knowledge in networking, OSI model, TCP, etc.:

P.S. This blog (wishmesh.com) is not optimized for anything (speed, size, etc.). People are lazy. They optimize only when there is reason to do it, and we like most humans are lazy, so this blog runs on default WordPress hosted on shared server.