diff --git a/modules/vstudio/tests/cs2005/test_files.lua b/modules/vstudio/tests/cs2005/test_files.lua
index f5fe5604..5ba8c3b3 100644
--- a/modules/vstudio/tests/cs2005/test_files.lua
+++ b/modules/vstudio/tests/cs2005/test_files.lua
@@ -80,6 +80,25 @@
end
+ function suite.publicResourceDesignerDependency()
+ files { "Resources.resx", "Resources.Designer.cs" }
+ resourcegenerator 'public'
+
+ prepare()
+ test.capture [[
+
+ True
+ Resources.resx
+
+
+ PublicResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+ ]]
+ end
+
+
function suite.settingsDesignerDependency()
files { "Properties/Settings.settings", "Properties/Settings.Designer.cs" }
prepare()
diff --git a/src/_premake_init.lua b/src/_premake_init.lua
index 964c8cbd..26bd4233 100644
--- a/src/_premake_init.lua
+++ b/src/_premake_init.lua
@@ -1001,6 +1001,16 @@
tokens = true,
}
+ api.register {
+ name = "resourcegenerator",
+ scope = "project",
+ kind = "string",
+ allowed = {
+ "internal",
+ "public"
+ }
+ }
+
api.register {
name = "rtti",
scope = "config",
diff --git a/src/tools/dotnet.lua b/src/tools/dotnet.lua
index f933db89..3214a4f6 100644
--- a/src/tools/dotnet.lua
+++ b/src/tools/dotnet.lua
@@ -160,7 +160,15 @@
testname = basename .. ".Designer.cs"
if project.hasfile(fcfg.project, testname) then
info.SubType = "Designer"
- info.Generator = "ResXFileCodeGenerator"
+
+ local resourceAccessGenerator = "ResXFileCodeGenerator"
+ if fcfg.project.resourcegenerator then
+ if fcfg.project.resourcegenerator == "public" then
+ resourceAccessGenerator = "PublicResXFileCodeGenerator"
+ end
+ end
+
+ info.Generator = resourceAccessGenerator
info.LastGenOutput = path.getname(testname)
end
end