[.NET] InvalidOperationException exception occurs when generate the appconfiguration SDK
- Dominant language
- C#
- Stars
- 135
- Forks
- 260
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 115
Description
Repro spec PR:
https://github.com/Azure/azure-rest-api-specs/pull/32338
Detail errors:
```powershell
npx --package=@azure-tools/typespec-client-generator-cli --yes tsp-client init --tsp-config /mnt/vss/_work/1/s/azure-rest-api-specs/specification/appconfiguration/AppConfiguration/tspconfig.yaml --repo Azure/azure-rest-api-specs --commit 5b018404b6a11de8abe20251746c3d209119d7d3 --local-spec-repo /mnt/vss/_work/1/s/azure-rest-api-specs/specification/appconfiguration/AppConfiguration
[.Net] System.InvalidOperationException: Unable to find a model or framework type that corresponds to Azure.Data.AppConfiguration.ConfigurationSnapshotStatus?
[.Net] at AutoRest.CSharp.Generation.Types.TypeFactory.CreateType(ITypeSymbol symbol) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Common\Generation\Types\TypeFactory.cs:line 186
[.Net] at AutoRest.CSharp.Output.Builders.BuilderHelpers.GetTypeFromExisting(ISymbol existingMember, CSharpType defaultType, TypeFactory typeFactory) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Common\Output\Builders\BuilderHelpers.cs:line 225
[.Net] at AutoRest.CSharp.Output.Models.Types.ModelTypeProviderFields.CreateFieldFromExisting(ISymbol existingMember, CSharpType originalType, ValueExpression initializationValue, SerializationFormat serializationFormat, TypeFactory typeFactory, Boolean isRequired, Boolean optionalViaNullability) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Common\Output\Models\Types\ModelTypeProviderFields.cs:line 294
[.Net] at AutoRest.CSharp.Output.Models.Types.ModelTypeProviderFields..ctor(IReadOnlyList`1 properties, String modelName, InputModelTypeUsage inputModelUsage, TypeFactory typeFactory, ModelTypeMapping modelTypeMapping, InputType additionalPropertiesValueType, Boolean isStruct, Boolean isPropertyBag) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Common\Output\Models\Types\ModelTypeProviderFields.cs:line 58
[.Net] at AutoRest.CSharp.Output.Models.Types.ModelTypeProvider.get_Fields() in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Common\Output\Models\Types\ModelTypeProvider.cs:line 52
[.Net] at AutoRest.CSharp.Output.Models.Types.ModelTypeProvider.EnsureAdditionalPropertiesProperty() in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Common\Output\Models\Types\ModelTypeProvider.cs:line 59
[.Net] at AutoRest.CSharp.Output.Models.Types.ModelTypeProvider.get_AdditionalPropertiesProperty() in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Common\Output\Models\Types\ModelTypeProvider.cs:line 56
[.Net] at AutoRest.CSharp.Output.Models.Types.ModelTypeProvider.get_RawDataField() in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Common\Output\Models\Types\ModelTypeProvider.cs:line 77
[.Net] at AutoRest.CSharp.Generation.Writers.ModelWriter.WritePrivateRawDataField(CodeWriter writer, ObjectType schema) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Common\Generation\Writers\ModelWriter.cs:line 102
[.Net] at AutoRest.CSharp.Generation.Writers.ModelWriter.WriteObjectSchema(CodeWriter writer, ObjectType schema) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Common\Generation\Writers\ModelWriter.cs:line 75
[.Net] at AutoRest.CSharp.Generation.Writers.ModelWriter.WriteModel(CodeWriter writer, TypeProvider model) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Common\Generation\Writers\ModelWriter.cs:line 26
[.Net] at AutoRest.CSharp.AutoRest.Plugins.LowLevelTarget.ExecuteAsync(GeneratedCodeWorkspace project, InputNamespace inputNamespace, SourceInputModel sourceInputModel, Boolean isTspInput) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\LowLevel\AutoRest\LowLevelTarget.cs:line 26
[.Net] at AutoRest.CSharp.AutoRest.Plugins.CSharpGen.ExecuteAsync(InputNamespace rootNamespace) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Common\AutoRest\Plugins\CSharpGen.cs:line 92
[.Net] at AutoRest.CSharp.AutoRest.Communication.StandaloneGeneratorRunner.RunAsync(CommandLineOptions options) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Common\AutoRest\Communication\StandaloneGeneratorRunner.cs:line 62
[.Net] at AutoRest.CSharp.Program.Run(CommandLineOptions options) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Program.cs:line 47
[.Net] at AutoRest.CSharp.Program.<>c.<b__2_0>d.MoveNext() in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Program.cs:line 29
[.Net] --- End of stack trace from previous location ---
[.Net] at AutoRest.CSharp.Program.Main(String[] args) in D:\a\_work\1\s\autorest.csharp\src\AutoRest.CSharp\Program.cs:line 26
[.Net] at AutoRest.CSharp.Program.(String[] args)
[.Net] Aborted (core dumped)
[.Net] ExternalError: Emitter "@azure-tools/typespec-csharp" crashed! This is a bug.
```
@chunyu3 , can you have a look if this is a spec issue or codeGen issue?
Contributor guide
Assessment
This issue has not been assessed yet.