Question

In the process of moving my driver project to WDK8 and Visual Studio 2012, I came across a minor issue regarding the driver package output directory configuration. Fortunately, it is easy to reproduce using the standard project templates and these steps:

  1. Open VS 2012 and choose New Project from the start page
  2. In the "New Project" dialog, choose Installed | Templates | VisualC++ | Windows Driver | Networking | Filter Driver: NDIS. Change location to C:\Projects, select "Createdirectory for solution", and click OK.
  3. In the Standard toolbar, choose x64 in the Solution Platform dropdown.
  4. In the Solution Explorer, select both projects, right click and choose Properties from the shortcut menu.
  5. Choose "All Configurations" in the Configuration drop down, set Configuration Properties | General | Output Directory to "$(SolutionDir)bin\$(Platform)\$(ConfigurationName)\" to place all output in a bin subdirectory in the solution directory and click OK. At this point, dir \Projects\ndislsf1 returns:

         Directory of C:\Projects\ndislwf1
    
    
    04/25/2013  09:42 AM    <DIR>          .
    04/25/2013  09:42 AM    <DIR>          ..
    04/25/2013  09:42 AM    <DIR>          ndislwf1
    04/25/2013  09:42 AM    <DIR>          ndislwf1 Package
    04/25/2013  09:46 AM        14,811,136 ndislwf1.sdf
    04/25/2013  09:42 AM             7,627 ndislwf1.sln
                   2 File(s)     14,818,763 bytes
                   4 Dir(s)   6,701,723,648 bytes free
    
  6. Now, press F6 to build the solution

    All is well so far, dir \Projects\ndislsf1 shows our bin directory was created and further inspection shows all the output files were correctly placed there:

         Directory of C:\Projects\ndislwf1
    
    
    04/25/2013  09:47 AM    <DIR>          .
    04/25/2013  09:47 AM    <DIR>          ..
    04/25/2013  09:47 AM    <DIR>          bin
    04/25/2013  09:47 AM    <DIR>          ndislwf1
    04/25/2013  09:47 AM    <DIR>          ndislwf1 Package
    04/25/2013  09:46 AM        14,811,136 ndislwf1.sdf
    04/25/2013  09:42 AM             7,627 ndislwf1.sln
                   2 File(s)     14,818,763 bytes
                   5 Dir(s)   6,695,829,504 bytes free
    
  7. In the Standard toolbar, choose "Vista Release" in the Solution Configurations dropdown and press F6 again to build the solution

     Directory of C:\Projects\ndislwf1
    
    04/25/2013  09:51 AM              .
    04/25/2013  09:51 AM              ..
    04/25/2013  09:47 AM              bin
    04/25/2013  09:47 AM              ndislwf1
    04/25/2013  09:47 AM              ndislwf1 Package
    04/25/2013  09:46 AM        14,811,136 ndislwf1.sdf
    04/25/2013  09:42 AM             7,627 ndislwf1.sln
    04/25/2013  09:51 AM              x64
                   2 File(s)     14,818,763 bytes
                   6 Dir(s)   6,689,509,376 bytes free
    

Unfortunately, the Vista Release output is written to x64 instead of the bin subdirectory. In fact, all other projects' outputs' also ignore the bin subdirectory and write in x64.

Has anyone else experienced this problem, and if so, are there any known workarounds or fixes expected?

Was it helpful?

Solution

I had the same issues on most, but not all, of the build configurations (Vista Debug Win32 came out correctly for some reason). Here's how I worked around it/solved it:

  • Opened the nnn_package.vcxproj file in another editor.

  • Noticed that the entry for the above build configuration (vista|debug|win32) was located by itself, separated from all the other configuration entries by a "PropertyGroup" entry that, amongst other things, set "PackageDir"$(OutDir)nnn_package"/PackageDir"

(replace the " with less-than/more-than)

  • Moved this section to -after- all the build configuration entries and saved.

  • Reopened solution in VS2012 and now all packages output to the correct folder regardless of configuration name and platform.

Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top