Share via

Does it matter if I have using directives in my iOS/Android project that I don´t use?

Kim Strasser 2,536 Reputation points
2026-05-07T20:01:59.55+00:00

I have a few using directives in my project that are greyed out and I don´t know if I use one of these using directives in my iOS/Android project. Does it matter if I have using directives in my iOS/Android project that I don´t use when I submit my game for app review in the Apple App Store and Google Play Store?

Screenshot 2026-05-07 214918

Developer technologies | .NET | .NET MAUI
0 comments No comments

3 answers

Sort by: Most helpful
  1. Nancy Vo (WICLOUD CORPORATION) 3,550 Reputation points Microsoft External Staff Moderator
    2026-05-08T02:53:43.3533333+00:00

    Hello @Kim Strasser ,

    Thanks for your question.

    Unused using directives will not cause your app to be rejected by Apple App Store or Google Play Store. The using directive allows the use of types in a namespace so that you do not have to qualify the use of a type in that namespace. It is a source-level convenience and does not affect the compiled output.

    While unused using directives are harmless, it's better to remove them to keep code clean. In visual studio, you can do this quickly:

    • Right click in the file -> Remove and Sort Usings

    I hope this addresses your question. If this response was helpful, please consider following the guidance to provide feedback.

    0 comments No comments

  2. Radwan Almsora 0 Reputation points
    2026-05-07T22:59:56.76+00:00

    Hi Kim,

    ​Welcome to the Microsoft Q&A community!

    ​To answer your question directly: No, it does not matter. Unused using directives will not affect your app review process, nor will they impact the performance or size of your game on the Apple App Store or Google Play Store.

    ​Here is a technical breakdown of why this is the case:

    ​__1. Compiler Optimization__

    ​In C# and .NET, the compiler is smart enough to ignore unused using directives during the build process. These directives are only instructions for the compiler to look for types in specific namespaces; if no types from that namespace are used in your code, they are not included in the compiled Intermediate Language (IL).

    ​__2. App Store Submission__

    ​App Store (Apple) and Play Store (Google) reviewers focus on your app's functionality, security, and metadata. They review the compiled binary, not your source code formatting. Since unused using statements don't change the binary, they have zero impact on the review outcome.

    ​__3. Why are they greyed out?__

    ​The "greyed out" appearance is a feature of your IDE (like Visual Studio) to let you know that these lines are redundant. In .NET MAUI, some namespaces are also included automatically via Implicit Usings, making explicit declarations unnecessary.

    ​__Pro-Tip for Clean Code:__

    ​While it’s harmless to leave them, it is a Best Practice to keep your code clean. You can easily remove all unused directives by:

    • ​Right-clicking anywhere in the code editor.
    • ​Selecting "Remove and Sort Usings".
    • ​Or using the shortcut: Ctrl + R, Ctrl + G.

    ​__Did this answer your question?__ If so, please consider marking this as the "Accepted Answer" to help other community members with the same query!

    0 comments No comments

  3. Q&A Assist
    2026-05-07T20:02:15.0733333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Unused using directives do not affect app store submission. They are a style/cleanliness issue, not a functional or policy issue.

    In C# and .NET projects, an unused using:

    • Does not change the compiled IL in any meaningful way (the compiler ignores unused using directives).
    • Does not affect runtime behavior on iOS/Android.
    • Does not by itself cause an app to be rejected by Apple or Google.

    They can safely be left in, but removing them is recommended for readability and to avoid style warnings such as IDE0005 (“Remove unnecessary using directives”). If desired, IDE0005 can be suppressed or configured in the project’s code analysis settings.

    For .NET MAUI specifically, some namespaces are already brought in via implicit global using directives from the SDK, so explicit using statements for those may appear unnecessary even though they are harmless.


    References:

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.