Visual Studio 2019 settings not importing

Bishop Minter 41 Reputation points
2021-10-05T15:11:01.853+00:00

I'm trying to get custom settings imported to VS 2019 but it's not working. After making my changes I do:

Tools -> Import and Export Settings -> Export selected environment settings -> select all settings -> use default name Exported-2021-10-05.vssettings -> select directory to store settings in -> Finish -> and I get a successful export message.

I open a new instance of VS 2019:

Tools -> Import and Export Settings -> Import selected environment settings -> No, just import new settings... -> select the settings I just saved -> select all settings -> Finish -> and I get a successful import message

But I go into settings and nothing has changed.

The specific changes I'm making are:

Add C/C++/preprocessor definition/ _USE_32BIT_TIME_T
Change C/C++/Language/Conformance Code/No (/permissive)
Change Configuration Properties/Debugging/Working Directory/ ".."

These settings work as intended but saving them and importing them has no effect.

Ideally, I would like to change these settings to the default settings so when I open VS 2019 these settings are already in effect.

What am I doing wrong

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,446 questions
Visual Studio Setup
Visual Studio Setup
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
939 questions
0 comments No comments
{count} votes

7 answers

Sort by: Most helpful
  1. RLWA32 38,861 Reputation points
    2021-10-05T15:50:10.227+00:00

    Add C/C++/preprocessor definition/ _USE_32BIT_TIME_T
    Change C/C++/Language/Conformance Code/No (/permissive)
    Change Configuration Properties/Debugging/Working Directory/ ".."

    These look like properties of a C++ project rather than settings for the Visual Studio IDE. That's probably why exporting and importing Visual Studio settings doesn't reflect your changes.

    Take a look at using a custom property sheet -- create-reusable-property-configurations


  2. RLWA32 38,861 Reputation points
    2021-10-06T21:07:29.857+00:00

    And to add the Debugging Working Directory to your property sheet you can manually edit the .props file as described here - is-it-possible-to-change-the-working-directory-through-vc-property-sheet Your setting will be reflected in the solution explorer project property page but not when you view your custom sheet in the property manager.

    0 comments No comments

  3. Bishop Minter 41 Reputation points
    2021-10-07T13:28:08.887+00:00

    I originally had the Property Sheet at the top of only Debug |x64 but I put it the top of all of them and that fixed one of the issues.

    Note: I have pictures for all the items listed below but this site won't let me post them for some reason

    My Property Sheet Preprocessor setting looks like this:

    WIN32;_DEBUG;_CONSOLE;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)

    iand is bold and doesn't show this change in the Properties Page. Same goes for the Comformance Mode setting.

    No(/permissive)

    iand is bold and doesn't show this change in the Properties Page. The Include Directories setting shows:

    C:\DS\TEST\src\CPP;C:\DS\TEST\src\HEADER;$(IncludePath)

    is not bold but this does show the change in the Property Page.

    There is no Working Directory setting in the Property Sheet but I change the .props file like you suggested and Working Directory setting in the Property Page is showing that change. So in summary, the Working Directory and Include Directories setting are not bold and show the change in the Property Page. Both of these settings fall under the Configuration Properties main heading in the Property Page. The two settings under the main heading C/C++, Preprocessor Definitions and Conformance Mode, are bold and do not show the change I made in the Property Sheet. It's worth noting that all of the settings I changed in the Property sheet are all bold including the Include Directories setting. There's something that's affecting the C/C++ main heading settings that aren't taking affect in the Property Page. Property Sheet code:

    <code>
    <?xml version="1.0" encoding="utf-8"?>
    <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <ImportGroup Label="PropertySheets" />
    <PropertyGroup Label="UserMacros" />
    <PropertyGroup>
    <IncludePath>C:\DS\TEST\src\CPP;C:\DS\TEST\src\Header;$(IncludePath)</IncludePath>
    </PropertyGroup>
    <ItemDefinitionGroup>
    <ClCompile>
    <ConformanceMode>false</ConformanceMode>
    <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ClCompile>
    </ItemDefinitionGroup>
    <PropertyGroup Label="Debugging Properties">
    <LocalDebuggerWorkingDirectory>..</LocalDebuggerWorkingDirectory>
    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
    </PropertyGroup>
    <ItemGroup />
    </Project>
    </code>


  4. Bishop Minter 41 Reputation points
    2021-10-07T14:59:45.667+00:00

    Yes I understood what you pointed out about bold setting overriding Property Sheet settings. My issue is that when I set Conformance and Preprocessor settings in the Property Page (inherit from parent or project defaults) this setting reverts back when I open another instance of VS. Those changes are in my Property Sheet just as are the changes for Working Directory and Include Directories but those work across new instances of VS. Why do Preprocessor and Conformance settings in the Property Page, (inherit from parent or project defaults), not persist to new instances of VS?


  5. Bishop Minter 41 Reputation points
    2021-10-07T15:28:40.497+00:00

    That's what I'm doing. There are 4 changes in my Property Sheet that I load for every instance of VS I open. But only 2 of them persist. I'm trying to find out why the other two I keep having to reset manually for each new instance of VS.