Attention: We are retiring the ASP.NET Community Blogs. Learn more >

Jeff Widmer's Blog

ASP.NET, ASP.NET MVC, C#, VB.NET, IIS7, Windows Forms, VB6, ASP 3.0

  • Running IPSwitch WS_FTP on Windows Server 2003 SP1 - Data Execution Prevention (DEP)

    I had a problem running WS_FTP (http://www.ipswitch.com/products/ws_ftp/index.asp) on my Windows Server 2003 machine with SP1.  Whenever I would start an FTP transfer the application would crash.  Finally I figured out it was Data Execution Prevention that was preventing it from running.  Data Exection Prevention monitors your programs to determine if they use system memory safely. To do this, DEP software works alone or with compatible microprocessors to mark some memory locations as "non-executable." If a program tries to run code—malicious or not—from a protected location, DEP closes the program and notifies you. [REFERENCE: WINDOWS HELP]

    DEP can be found under System Properties > Advanced Tab > Performance Settings > Data Execution Prevention Tab

    Allowing WS_FTP in the above dialog solved the problem.

  • Remote Desktop to Console Session on Windows Server 2003

    When you Remote Desktop to a Windows XP Professional computer, you always connect to the console session.  This is the default for Remote Desktop to Windows XP Professional.  When you remote desktop to a Windows Server 2003 computer, the default is to start a new session.  But you can easily connect to the console session of a Windows Server 2003 computer using the /console switch.  This is nice because at work I run Windows Server 2003 as my operating system.  Then when I go home and Remote Desktop to my work computer, I can get to all of my currently running applications without having to start them up again.

    To start Remote Desktop in console mode, run this from the command-line:

    mstsc /console

    UPDATE (8/15/2008):  Windows Vista remote desktop client does not use the /console switch anymore.  It now uses a different switch (/admin) to get to the console session on the server (thanks Drewskie):

    mstsc /admin

  • VS2005 Code Snippets

    In VS2005, Code Snippets can be found by right-clicking in your code page and choosing Insert Snippet.  Also, all of the snippets have a shortcut.  Type the shortcut and then press tab and the code snippet will be automatically inserted.  For instance to automatically insert a code snippet for a for each loop type "foreach" and then press tab.

    All of the code snippets can be found here:
    VB: C:\Program Files\Microsoft Visual Studio 8\VB\Snippets
    C#: C:\Program Files\Microsoft Visual Studio 8\VC#\Snippets
    and then you can use the manager to register your own code snippet folder and create your own.
     
    Here's one that I use for inserting a public property
     
    <?xml version="1.0" encoding="UTF-8"?>
    <CodeSnippets xmlns="
    http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
      <CodeSnippet Format="1.0.0">
        <Header>
          <Title>Insert Property String</Title>
          <Author>Jeff Widmer</Author>
          <Description>Insert Property String</Description>
          <Shortcut>vbpropstring</Shortcut>
          <HelpUrl></HelpUrl>
        </Header>
        <Snippet>
      <Imports>
       <Import>
        <Namespace>System</Namespace>
       </Import>
      </Imports>
      <Declarations>
            <Literal>
              <ID>PropertyName</ID>
              <Type>String</Type>
              <ToolTip>Replace with property name.</ToolTip>
              <Default>X</Default>
            </Literal>
            <Literal>
              <ID>PropertyType</ID>
              <Type>
              </Type>
              <ToolTip>Replace with the property type.</ToolTip>
              <Default>String</Default>
            </Literal>
          </Declarations>
          <Code Language="VB" Kind="method decl">
        <![CDATA[Private _$PropertyName$ As $PropertyType$ = String.Empty
    Public Property $PropertyName$() As $PropertyType$
        Get
            Return _$PropertyName$
        End Get
        Set(ByVal value As $PropertyType$)
            _$PropertyName$ = value
        End Set
    End Property]]></Code>
        </Snippet>
      </CodeSnippet>
    </CodeSnippets>
  • What happened to WebAdmin.axd?

    Create your own WebAdmin link outside of Visual Studio 2005:

    WARNING: THIS HAS NOT BEEN THOROUGHLY TESTED.  USE AT OWN RISK.

    NOTE: THIS WORKS IN BETA2

    • Create a virtual directory at the root of your default website
    • Name the virtual WebAdmin
    • Set the Path of the Virtual Directory to "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\ASP.NETWebAdminFiles" where 50215 is the appropriate build version for your installed .NET 2.0 framework.
    • After the Virtual Directory has been created, right click on the Virtual Directory and got to properties.  Select the ASP.NET tab and make sure the ASP.NET version is set to a 2.0 version.
    • Open a browser and browse to the following url:
      http://localhost/webadmin/default.aspx?applicationPhysicalPath=D:\wwwroot\timetracker\&applicationUrl=/Timetracker
    • Make sure to change the applicationPhysicalPath and applicationUrl querystring parameters to match whatever they are on your system.

     

  • MSCONFIG Tool: Troubleshooting problems on Windows XP

    I was seeing some strange problems with my Windows XP machine.  “My Computer” would hang for approximately 2 minutes before displaying the list of drives and “Send To” would not enumerate the items to send to (it would also cause explorer to hang for a while).  This started only a couple of days ago and I could not determine what had changed to start causing the problems.  Searching Microsoft's website for answers, I came across the MSCONFIG tool:
    http://support.microsoft.com/default.aspx?scid=kb;en-us;310560

    This tool will let you set how to startup your machine.  Very nice and easy way to diagnose problems on yourWindows XP machine. 

    Eventually I narrowed the problem down to the Windows Image Acquisition (WIA) Service by using the MSCONFIG tool.