Author: devonenote

  • IDE/ATAPI Account does not have sufficient privilege to open attachment

    You might get following error after you move or replace a virtual disk drive file of a hyper-v virtual machine.

    An error occurred while attempting to start the selected virtual machine(s).

    'TestVM' failed to start.
    Microsoft Emulated IDE Controller (Instance ID
    {83F8638B-8DCA-4152-9EDA-2CA8B33039B4}): Failed to Power on with Error 'General
    access denied error'
    IDE/ATAPI Account does not have sufficient privilege to open attachment
    'D:VMTestVMTestVM.vhd. Error: ‘General access denied error'
    Account does not have sufficient privilege to open attachment
    'D:VMTestVMTestVM.vhd. Error: ‘General access denied error'
    

    This is because the permissions on the new virtual hard drive (D:VMTestVMTestVM.vhd in this case) are incorrect. Here is the steps to fix this permission file.

    1. Open Hyper-V manager, Right click settings of the virtual machine
    2. Find the Virtual Hard Drive and choose “Remove”.
    3. Re-add the same Virtual Hard Drive back to the machine.
    4. Now start the VM again, it should boot successfully.
  • IIS 7.5 Error The temp directory in chart handler configuration is not accessible

    If you build a web application with Chart control for ASP.NET 4.0 and deploy the site to web server.  You might get following error on the live site:

    The temp directory in chart handler configuration is not accessible

    To resolve this, first go to web.config and find the ChartImage directory in appsettings.

    <appSettings>
    <add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:TempImageFiles;" />
    </appSettings>

    The go to the temp chart image directory and grant read and write permission to IIS working process account in share properties – security tab. Note that the account runs IIS working process is different between IIS 7 and IIS 7.5

    • On Windows Server 2008 has IIS7, grant Read and Write permission to Network Service
    • On Windows server 2008 R2 has IIS 7.5, grant Read and Write permission to AppPool<PoolName>. Replace <PoolName> to the actual machine pool your site is running on, for example, if your site is running on pool named ASP.NET v4.0, then the account you need grant permission would be IIS AppPoolASP.NET v4.0, you can refer this step by step instructions for detail
  • iPhone Tips–Change Calendar TimeZone

    When you move or trip to other timezone, iPhone won’t refresh the timezone information in to correct one, this results calendar syncs to Exchange server still on the old timezone and all meetings show wrong start time than they are. To fix this, go to Settings => Mail, Contacts, Calendars =>Calendars => Time Zone Support,  either turn it off or set to proper TimeZone

  • Remove dead using statements

    Visual Studio has a great feature to easily remove all dead using statements in your code.

    The steps are pretty straightforward.

    1. Right click anywhere from the code
    2. Select Organize Using and
    3. Select Remove Unused Usings.

    image

  • Could not load file or assembly TraceWrapper, Version=1.0.523.0

    There are two versions of the TraceWrapper.dll in SCVMM install CD. One is x86 version and the other is x64 version. When you build your application on top of SCVMM library Microsoft.SystemCenter.VirtualMachineManager, it’s very important to pick up the correct version TraceWrapper.dll. In general, you should copy the 32 bit dll if you are using 32 bit system, copy 64 bit dll if you are using 64 bit system. Otherwise following BadImageFormatException would occur during runtime.

    Could not load file or assembly ‘TraceWrapper, Version=1.0.523.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. An attempt was made to load a program with an incorrect format.

    However, you should keep using 32 bit TraceWrapper on a 64 bit system for following scenarios:

    • You need debug your app in Visual Studio directly. In this case, process launched from Visual Studio debugger runs in WOW64 mode.
    • IIS is configured to run in 32 bit mode. In this case, all working processes run in WOW64 mode.

    This is because in 64 bit windows, processes in WOW64 mode are 32 bit processes and can’t load 64 bit TraceWrapper.dll.

  • CSharp – Get Assembly and File Version

    If you want to know the version of currently executing managed assembly, you can use Reflection.Assembly.

    Here is code snippet which can be used to do get managed assembly version.

    private string GetVersion()
    {
          return Assembly.GetExecutingAssembly().GetName().Version.ToString();
    }

  • Windows Server 2008 R2 with SP1 ISO download

    After Microsoft releases Windows 7 / Windows Server 2008 R2 Service Pack 1 to public, Microsoft now provides single evaluation media ISO for Windows Server 2008 R2 with Service Pack 1 for free download. To download the official ISO just access http://technet.microsoft.com/en-us/evalcenter/dd459137.aspx and logon with your windows live ID.

    Or use this Direct Download Link

    File Name:  7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso
    File Size: 2.9GB

    The expiration period expires after 180 days. After that the windows system will run with reduced functionalities and reboot every hour.

  • SQL Server 2005 The full-text search service cannot start

    After you install SQL Server 2005 RTM on windows server 2008, the full-text search service cannot start. This is because the full-text search service depends on the NTLMSSP (NTLM Security Support Provider) service but the NTLMSSP service does not exist on Windows Server 2008.

    To resolve this problem, simple install SQL Server 2005 SP3

    SQL Server 2005 SP3 can be downloaded from http://www.microsoft.com/downloads/en/details.aspx?FamilyID=ae7387c3-348c-4faa-8ae5-949fdfbe59c4

  • Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list

    You might see following error when browse your application site targeting ASP.NET 4.0 on IIS 7 or 7.5 server.

    HTTP Error 500.21 – Internal Server Error
    Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list

    Cause & Solution

    If IIS is enabled after DotNet 4 installation then ASP.NET is not registered with IIS. You will see the error if your site is targeting ASP.NET 4. To resolve this issue, run the following from elevated command line to register ASP.NET 4:

    aspnet_regiis.exe –i

    This will register asp.net with IIS. The aspnet_regiis.exe file can be found in either

    • %windir%Microsoft.NETFrameworkv4.0.30319
    • %windir%Microsoft.NETFramework64v4.0.30319 (on a 64-bit machine)

    More info for ASP.NET IIS Registration Tool (Aspnet_regiis.exe) can be found at http://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx

  • Syspreped Windows 7 fail with “Windows could not finish configuring the system”

    After you have installed a Windows 7 or Windows Server 2008 R2, install and configure windows features, install your own app, and then run sysprep command to create an image that is ready to be deployed. When you boot windows for the first time,  it might comes up with following message at the windows setup stage "Setup is starting services" window.

    Windows could not finish configuring the system. To attempt to resume configuration, restart the computer.

    After you restart the system, you might keep getting the same error.

    This is usually caused one of windows features installed or configured not supported by sysprep. The workaround is move the configuration to post setup scripts.