diff --git a/pkg/codegen/dotnet/gen.go b/pkg/codegen/dotnet/gen.go
index 48440503e7f8..19a188047fa9 100644
--- a/pkg/codegen/dotnet/gen.go
+++ b/pkg/codegen/dotnet/gen.go
@@ -40,17 +40,6 @@ import (
"github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"
)
-type stringSet map[string]struct{}
-
-func (ss stringSet) add(s string) {
- ss[s] = struct{}{}
-}
-
-func (ss stringSet) has(s string) bool {
- _, ok := ss[s]
- return ok
-}
-
type typeDetails struct {
outputType bool
inputType bool
@@ -304,7 +293,7 @@ func simplifyInputUnion(union *schema.UnionType) *schema.UnionType {
}
func (mod *modContext) unionTypeString(t *schema.UnionType, qualifier string, input, wrapInput, state, requireInitializers bool) string {
- elementTypeSet := stringSet{}
+ elementTypeSet := codegen.StringSet{}
var elementTypes []string
for _, e := range t.ElementTypes {
// If this is an output and a "relaxed" enum, emit the type as the underlying primitive type rather than the union.
@@ -314,8 +303,8 @@ func (mod *modContext) unionTypeString(t *schema.UnionType, qualifier string, in
}
et := mod.typeString(e, qualifier, input, state, false)
- if !elementTypeSet.has(et) {
- elementTypeSet.add(et)
+ if !elementTypeSet.Has(et) {
+ elementTypeSet.Add(et)
elementTypes = append(elementTypes, et)
}
}
@@ -2194,7 +2183,7 @@ func genProjectFile(pkg *schema.Package,
packageReferences = map[string]string{}
}
if _, ok := packageReferences["Pulumi"]; !ok {
- packageReferences["Pulumi"] = "3.*"
+ packageReferences["Pulumi"] = "[3.23.0,4)"
}
w := &bytes.Buffer{}
err := csharpProjectFileTemplate.Execute(w, csharpProjectFileTemplateContext{
diff --git a/pkg/codegen/testing/test/testdata/azure-native-nested-types/dotnet/Pulumi.AzureNative.csproj b/pkg/codegen/testing/test/testdata/azure-native-nested-types/dotnet/Pulumi.AzureNative.csproj
index 8a2d60cb264f..002e69b30b55 100644
--- a/pkg/codegen/testing/test/testdata/azure-native-nested-types/dotnet/Pulumi.AzureNative.csproj
+++ b/pkg/codegen/testing/test/testdata/azure-native-nested-types/dotnet/Pulumi.AzureNative.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/cyclic-types/dotnet/Pulumi.Example.csproj b/pkg/codegen/testing/test/testdata/cyclic-types/dotnet/Pulumi.Example.csproj
index 852b9550bbff..1e7e4bd6ba4f 100644
--- a/pkg/codegen/testing/test/testdata/cyclic-types/dotnet/Pulumi.Example.csproj
+++ b/pkg/codegen/testing/test/testdata/cyclic-types/dotnet/Pulumi.Example.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/dash-named-schema/dotnet/Pulumi.FooBar.csproj b/pkg/codegen/testing/test/testdata/dash-named-schema/dotnet/Pulumi.FooBar.csproj
index 5b10aee99af5..ccad09387ea3 100644
--- a/pkg/codegen/testing/test/testdata/dash-named-schema/dotnet/Pulumi.FooBar.csproj
+++ b/pkg/codegen/testing/test/testdata/dash-named-schema/dotnet/Pulumi.FooBar.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/dashed-import-schema/dotnet/Pulumi.Plant.csproj b/pkg/codegen/testing/test/testdata/dashed-import-schema/dotnet/Pulumi.Plant.csproj
index 852b9550bbff..1e7e4bd6ba4f 100644
--- a/pkg/codegen/testing/test/testdata/dashed-import-schema/dotnet/Pulumi.Plant.csproj
+++ b/pkg/codegen/testing/test/testdata/dashed-import-schema/dotnet/Pulumi.Plant.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/functions-secrets/dotnet/Pulumi.Mypkg.csproj b/pkg/codegen/testing/test/testdata/functions-secrets/dotnet/Pulumi.Mypkg.csproj
index 852b9550bbff..1e7e4bd6ba4f 100644
--- a/pkg/codegen/testing/test/testdata/functions-secrets/dotnet/Pulumi.Mypkg.csproj
+++ b/pkg/codegen/testing/test/testdata/functions-secrets/dotnet/Pulumi.Mypkg.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/hyphen-url/dotnet/Pulumi.Registrygeoreplication.csproj b/pkg/codegen/testing/test/testdata/hyphen-url/dotnet/Pulumi.Registrygeoreplication.csproj
index bdfdcd15d92c..88b877c46a12 100644
--- a/pkg/codegen/testing/test/testdata/hyphen-url/dotnet/Pulumi.Registrygeoreplication.csproj
+++ b/pkg/codegen/testing/test/testdata/hyphen-url/dotnet/Pulumi.Registrygeoreplication.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/naming-collisions/dotnet/Pulumi.Example.csproj b/pkg/codegen/testing/test/testdata/naming-collisions/dotnet/Pulumi.Example.csproj
index 852b9550bbff..1e7e4bd6ba4f 100644
--- a/pkg/codegen/testing/test/testdata/naming-collisions/dotnet/Pulumi.Example.csproj
+++ b/pkg/codegen/testing/test/testdata/naming-collisions/dotnet/Pulumi.Example.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/nested-module-thirdparty/dotnet/Pulumi.FooBar.csproj b/pkg/codegen/testing/test/testdata/nested-module-thirdparty/dotnet/Pulumi.FooBar.csproj
index 852b9550bbff..1e7e4bd6ba4f 100644
--- a/pkg/codegen/testing/test/testdata/nested-module-thirdparty/dotnet/Pulumi.FooBar.csproj
+++ b/pkg/codegen/testing/test/testdata/nested-module-thirdparty/dotnet/Pulumi.FooBar.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/output-funcs-edgeorder/dotnet/Pulumi.Myedgeorder.csproj b/pkg/codegen/testing/test/testdata/output-funcs-edgeorder/dotnet/Pulumi.Myedgeorder.csproj
index 852b9550bbff..1e7e4bd6ba4f 100644
--- a/pkg/codegen/testing/test/testdata/output-funcs-edgeorder/dotnet/Pulumi.Myedgeorder.csproj
+++ b/pkg/codegen/testing/test/testdata/output-funcs-edgeorder/dotnet/Pulumi.Myedgeorder.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/output-funcs-tfbridge20/dotnet/Pulumi.Mypkg.csproj b/pkg/codegen/testing/test/testdata/output-funcs-tfbridge20/dotnet/Pulumi.Mypkg.csproj
index 5eb018749352..1ba1426ec5d7 100644
--- a/pkg/codegen/testing/test/testdata/output-funcs-tfbridge20/dotnet/Pulumi.Mypkg.csproj
+++ b/pkg/codegen/testing/test/testdata/output-funcs-tfbridge20/dotnet/Pulumi.Mypkg.csproj
@@ -50,7 +50,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/output-funcs/dotnet/Pulumi.Mypkg.csproj b/pkg/codegen/testing/test/testdata/output-funcs/dotnet/Pulumi.Mypkg.csproj
index 5eb018749352..1ba1426ec5d7 100644
--- a/pkg/codegen/testing/test/testdata/output-funcs/dotnet/Pulumi.Mypkg.csproj
+++ b/pkg/codegen/testing/test/testdata/output-funcs/dotnet/Pulumi.Mypkg.csproj
@@ -50,7 +50,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/plain-and-default/dotnet/Pulumi.FooBar.csproj b/pkg/codegen/testing/test/testdata/plain-and-default/dotnet/Pulumi.FooBar.csproj
index 852b9550bbff..1e7e4bd6ba4f 100644
--- a/pkg/codegen/testing/test/testdata/plain-and-default/dotnet/Pulumi.FooBar.csproj
+++ b/pkg/codegen/testing/test/testdata/plain-and-default/dotnet/Pulumi.FooBar.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/plain-object-defaults/dotnet/Pulumi.Example.csproj b/pkg/codegen/testing/test/testdata/plain-object-defaults/dotnet/Pulumi.Example.csproj
index 852b9550bbff..1e7e4bd6ba4f 100644
--- a/pkg/codegen/testing/test/testdata/plain-object-defaults/dotnet/Pulumi.Example.csproj
+++ b/pkg/codegen/testing/test/testdata/plain-object-defaults/dotnet/Pulumi.Example.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/plain-object-disable-defaults/dotnet/Pulumi.Example.csproj b/pkg/codegen/testing/test/testdata/plain-object-disable-defaults/dotnet/Pulumi.Example.csproj
index 852b9550bbff..1e7e4bd6ba4f 100644
--- a/pkg/codegen/testing/test/testdata/plain-object-disable-defaults/dotnet/Pulumi.Example.csproj
+++ b/pkg/codegen/testing/test/testdata/plain-object-disable-defaults/dotnet/Pulumi.Example.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/plain-schema-gh6957/dotnet/Pulumi.Xyz.csproj b/pkg/codegen/testing/test/testdata/plain-schema-gh6957/dotnet/Pulumi.Xyz.csproj
index 0da5aa49bc3b..09ca698d9fee 100644
--- a/pkg/codegen/testing/test/testdata/plain-schema-gh6957/dotnet/Pulumi.Xyz.csproj
+++ b/pkg/codegen/testing/test/testdata/plain-schema-gh6957/dotnet/Pulumi.Xyz.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/regress-8403/dotnet/Pulumi.Mongodbatlas.csproj b/pkg/codegen/testing/test/testdata/regress-8403/dotnet/Pulumi.Mongodbatlas.csproj
index 852b9550bbff..1e7e4bd6ba4f 100644
--- a/pkg/codegen/testing/test/testdata/regress-8403/dotnet/Pulumi.Mongodbatlas.csproj
+++ b/pkg/codegen/testing/test/testdata/regress-8403/dotnet/Pulumi.Mongodbatlas.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/regress-node-8110/dotnet/Pulumi.My8110.csproj b/pkg/codegen/testing/test/testdata/regress-node-8110/dotnet/Pulumi.My8110.csproj
index 852b9550bbff..1e7e4bd6ba4f 100644
--- a/pkg/codegen/testing/test/testdata/regress-node-8110/dotnet/Pulumi.My8110.csproj
+++ b/pkg/codegen/testing/test/testdata/regress-node-8110/dotnet/Pulumi.My8110.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/replace-on-change/dotnet/Pulumi.Example.csproj b/pkg/codegen/testing/test/testdata/replace-on-change/dotnet/Pulumi.Example.csproj
index 852b9550bbff..1e7e4bd6ba4f 100644
--- a/pkg/codegen/testing/test/testdata/replace-on-change/dotnet/Pulumi.Example.csproj
+++ b/pkg/codegen/testing/test/testdata/replace-on-change/dotnet/Pulumi.Example.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/resource-args-python-case-insensitive/dotnet/Pulumi.Example.csproj b/pkg/codegen/testing/test/testdata/resource-args-python-case-insensitive/dotnet/Pulumi.Example.csproj
index 852b9550bbff..1e7e4bd6ba4f 100644
--- a/pkg/codegen/testing/test/testdata/resource-args-python-case-insensitive/dotnet/Pulumi.Example.csproj
+++ b/pkg/codegen/testing/test/testdata/resource-args-python-case-insensitive/dotnet/Pulumi.Example.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/resource-args-python/dotnet/Pulumi.Example.csproj b/pkg/codegen/testing/test/testdata/resource-args-python/dotnet/Pulumi.Example.csproj
index 852b9550bbff..1e7e4bd6ba4f 100644
--- a/pkg/codegen/testing/test/testdata/resource-args-python/dotnet/Pulumi.Example.csproj
+++ b/pkg/codegen/testing/test/testdata/resource-args-python/dotnet/Pulumi.Example.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/resource-property-overlap/dotnet/Pulumi.Example.csproj b/pkg/codegen/testing/test/testdata/resource-property-overlap/dotnet/Pulumi.Example.csproj
index 852b9550bbff..1e7e4bd6ba4f 100644
--- a/pkg/codegen/testing/test/testdata/resource-property-overlap/dotnet/Pulumi.Example.csproj
+++ b/pkg/codegen/testing/test/testdata/resource-property-overlap/dotnet/Pulumi.Example.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/secrets/dotnet/Pulumi.Mypkg.csproj b/pkg/codegen/testing/test/testdata/secrets/dotnet/Pulumi.Mypkg.csproj
index 852b9550bbff..1e7e4bd6ba4f 100644
--- a/pkg/codegen/testing/test/testdata/secrets/dotnet/Pulumi.Mypkg.csproj
+++ b/pkg/codegen/testing/test/testdata/secrets/dotnet/Pulumi.Mypkg.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/simple-enum-schema/dotnet/Pulumi.Plant.csproj b/pkg/codegen/testing/test/testdata/simple-enum-schema/dotnet/Pulumi.Plant.csproj
index 852b9550bbff..1e7e4bd6ba4f 100644
--- a/pkg/codegen/testing/test/testdata/simple-enum-schema/dotnet/Pulumi.Plant.csproj
+++ b/pkg/codegen/testing/test/testdata/simple-enum-schema/dotnet/Pulumi.Plant.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/simple-methods-schema-single-value-returns/dotnet/Pulumi.Example.csproj b/pkg/codegen/testing/test/testdata/simple-methods-schema-single-value-returns/dotnet/Pulumi.Example.csproj
index 852b9550bbff..1e7e4bd6ba4f 100644
--- a/pkg/codegen/testing/test/testdata/simple-methods-schema-single-value-returns/dotnet/Pulumi.Example.csproj
+++ b/pkg/codegen/testing/test/testdata/simple-methods-schema-single-value-returns/dotnet/Pulumi.Example.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/simple-methods-schema/dotnet/Pulumi.Example.csproj b/pkg/codegen/testing/test/testdata/simple-methods-schema/dotnet/Pulumi.Example.csproj
index 2b53b9f1ef60..d0a3cbcf592d 100644
--- a/pkg/codegen/testing/test/testdata/simple-methods-schema/dotnet/Pulumi.Example.csproj
+++ b/pkg/codegen/testing/test/testdata/simple-methods-schema/dotnet/Pulumi.Example.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/simple-plain-schema-with-root-package/dotnet/Pulumi.Example.csproj b/pkg/codegen/testing/test/testdata/simple-plain-schema-with-root-package/dotnet/Pulumi.Example.csproj
index 852b9550bbff..1e7e4bd6ba4f 100644
--- a/pkg/codegen/testing/test/testdata/simple-plain-schema-with-root-package/dotnet/Pulumi.Example.csproj
+++ b/pkg/codegen/testing/test/testdata/simple-plain-schema-with-root-package/dotnet/Pulumi.Example.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/simple-plain-schema/dotnet/Pulumi.Example.csproj b/pkg/codegen/testing/test/testdata/simple-plain-schema/dotnet/Pulumi.Example.csproj
index 852b9550bbff..1e7e4bd6ba4f 100644
--- a/pkg/codegen/testing/test/testdata/simple-plain-schema/dotnet/Pulumi.Example.csproj
+++ b/pkg/codegen/testing/test/testdata/simple-plain-schema/dotnet/Pulumi.Example.csproj
@@ -45,7 +45,7 @@
-
+
diff --git a/pkg/codegen/testing/test/testdata/simple-resource-schema/dotnet/Pulumi.Example.csproj b/pkg/codegen/testing/test/testdata/simple-resource-schema/dotnet/Pulumi.Example.csproj
index 852b9550bbff..1e7e4bd6ba4f 100644
--- a/pkg/codegen/testing/test/testdata/simple-resource-schema/dotnet/Pulumi.Example.csproj
+++ b/pkg/codegen/testing/test/testdata/simple-resource-schema/dotnet/Pulumi.Example.csproj
@@ -45,7 +45,7 @@
-
+