Skip to content

Conversation

@ArcturusZhang
Copy link
Member

@ArcturusZhang ArcturusZhang commented Jul 19, 2024

Because of a change in dotnet generator, now the dotnet generated code will not include using statements for those namespaces that are parent of the current namespace.
For example, if our current namespace is Azure.ResourceManager.Compute.Samples:

namespace Azure.ResourceManager.Compute.Samples;

the using Azure;, using Azure.ResourceManager;, using Azure.ResourceManager.Compute; statements will not be generated into the sample file, even if members from those namespaces are used below.

This is fine when we are building the sample projects, but it is not fine if we extract the sample code into a standalone program which is under a different namespace.

This PR fixes this by adding the namespace trimming the .Samples suffix, and always add the namespace of Azure and Azure.ResourceManager because they are so common that every sample program should need them.

@ArcturusZhang ArcturusZhang requested a review from a team as a code owner July 19, 2024 03:36
@weidongxu-microsoft weidongxu-microsoft merged commit 5f36715 into Azure:main Jul 19, 2024
WhitShake pushed a commit to WhitShake/azure-sdk-tools that referenced this pull request Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants