Hello @Kurt K,
I really appreciate your engagement and patience in troubleshooting the issue. To assist you and others who may encounter a similar issue, I have summarized the problem and its resolution below for clarity.
Problem Summary
The issue arose due to ApplicationVersion
and ApplicationDisplayVersion
being defined in multiple locations within the project, leading to conflicts during the build process, particularly in multi-targeted .NET projects.
Resolution
To resolve this issue, I recommend avoiding multi-targeting by building one target framework at a time. Additionally, ensure that version properties are defined consistently and appropriately for your project’s requirements.
- Specify a Single Target Framework in the
.csproj
File
Modify your.csproj
file to target a single framework at a time, rather than using multi-targeting. Update theTargetFrameworks
property to a singleTargetFramework
as shown below:<!-- Before (Multi-Targeting) --> <TargetFrameworks>net9.0-ios;net9.0-maccatalyst;net9.0-windows10.0.19041</TargetFrameworks> <!-- After (Single Target, Choose One) --> <TargetFramework>net9.0-ios</TargetFramework> <!-- OR --> <TargetFramework>net9.0-maccatalyst</TargetFramework> <!-- OR --> <TargetFramework>net9.0-windows10.0.19041</TargetFramework>
Note that you should choose one of the target frameworks based on your current development focus. If you need to build for multiple platforms, consider doing so in separate builds rather than in a single multi-targeted build.
- Define Version Properties Consistently If all platforms share the same version, define
ApplicationDisplayVersion
andApplicationVersion
only once in the.csproj
file, outside of any platform-specific conditional blocks:<PropertyGroup> <ApplicationDisplayVersion>1.1</ApplicationDisplayVersion> <ApplicationVersion>1</ApplicationVersion> </PropertyGroup>
- Handle Platform-Specific Versioning If your application requires different versions for each platform (e.g., iOS = 1.2, Android = 1.1), set these values directly in the respective platform-specific manifest files:
- iOS:
Info.plist
- Android:
AndroidManifest.xml
- Windows:
Package.appxmanifest
- iOS:
- Clean and Rebuild the Project
After making these changes, clean your project to remove any cached build artifacts and then rebuild to ensure the new settings are applied correctly.
Additional Notes
- Ensure no duplicate definitions of
ApplicationVersion
orApplicationDisplayVersion
exist in your.csproj
file or other configuration files, as this can lead to conflicts. - For further details on resolving NuGet-related issues, refer to the official documentation: NuGet Error NU1105.
Again, thank you for your patience and collaboration in resolving this issue. If you have any further questions or need additional assistance, please feel free to reach out. I really appreciate your feedback.