fix warning around 'Properties\Settings.settings' in Visual Studio
Following warning is displayed in "Error List" windows in Visual Studio.
Severity Code Description Project File Line Suppression State
Warning A custom tool 'SettingsSingleFileGenerator' is associated with file 'Properties\Settings.settings', but the output of the custom tool was not found in the project. You may try re-running the custom tool by right-clicking on the file in the Solution Explorer and choosing Run Custom Tool.
Steps to Reproduce:
- File -> New -> Project -> Visual C# -> Windows Forms App (.NET Framework)
- And drop button1 to Fomr1 to generate Form1.resx.
- copy App.config, Form1.* Program.cs Properties*.*
- create CMakeLists.txt.
- cmake -G "Visual Studio 15 2017 Win64"
- double click *.sln file
CMakeLists.txt :
cmake_minimum_required(VERSION 3.8)
project(WindowsFormsApp1 VERSION 0.1.0 LANGUAGES CSharp)
include(CSharpUtilities)
add_executable(WindowsFormsApp1
App.config
Program.cs
Form1.cs
Form1.Designer.cs
Form1.resx
Properties/AssemblyInfo.cs
Properties/Resources.Designer.cs
Properties/Resources.resx
Properties/Settings.Designer.cs
Properties/Settings.settings
)
set_target_properties(WindowsFormsApp1 PROPERTIES
WIN32_EXECUTABLE true
VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.6.2"
VS_GLOBAL_ROOTNAMESPACE "WindowsFormsApp1"
)
csharp_set_windows_forms_properties(
Form1.cs
Form1.Designer.cs
Form1.resx
)
csharp_set_designer_cs_properties(
Properties/AssemblyInfo.cs
Properties/Resources.Designer.cs
Properties/Resources.resx
Properties/Settings.Designer.cs
Properties/Settings.settings
)
set_property(TARGET WindowsFormsApp1 PROPERTY VS_DOTNET_REFERENCES
System
System.Data
System.Drawing
System.Windows.Forms
System.Xml
)
Environment:
Windows 10 Pro version 1703 build 15063.674 Visual Studio 2017 Community Version 15.4.1 cmake-3.10.0-rc4-win64-x64.msi + Merge Requst !1449 (merged) (Original CMake can not generate C# project for Visual Studio japanease version.My Visual Studio is japanease version.)
Confirm the facts
.csproj file is different from Visual Studio. VS Settings.Designer.cs CMake Properties\Settings.Designer.cs
And warning disappeared when I revised LastGenOutput tag manually. Therefore, I think that this is a problem of CMake generator.
Fix and confirmation
I modified cmVisualStudio10TargetGenerator.cxx that generate LastGenOutput tag. And I generate C# project by this CMake(Merge request !1449 (merged) Applied), then warning disappeared.
Than you, and I'm sorry my poor English.