Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling as DLL with ApplicationDisplayVersion higher than 1.0 fails #10579

Closed
3steve3 opened this issue Oct 9, 2022 · 6 comments · Fixed by #15238
Closed

Compiling as DLL with ApplicationDisplayVersion higher than 1.0 fails #10579

3steve3 opened this issue Oct 9, 2022 · 6 comments · Fixed by #15238
Labels
area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer fixed-in-8.0.0-preview.5.8529 Look for this fix in 8.0.0-preview.5.8529! platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 t/bug Something isn't working

Comments

@3steve3
Copy link

3steve3 commented Oct 9, 2022

Description

When the ApplicationDisplayVersion is something else than 1.0, it will fail to build when also targeting net7.0 as DLL.
Possibly related to #6037.
Using Maui 7.0 with Visual Studio 17.4.0 Preview 2.1.

Steps to Reproduce

Create a new project.
Add net7.0 as a target
Change ApplicationDisplayVersion to 2.0
Project will fail to build after restore

Link to public reproduction project repository

https://github.com/3steve3/Maui-compile-as-DLL-error

Version with bug

Unknown/Other (please specify)

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows, macOS

Affected platform versions

All versions

Did you find any workaround?

Change Application Display version to 1.0

Relevant log output

project.assets.json says:

{
  "version": 3,
  "targets": {},
  "libraries": {},
  "projectFileDependencyGroups": {},
  "packageFolders": {
    "C:\\Users\\Steve\\.nuget\\packages\\": {},
    "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {}
  },
  "project": {
    "restore": {
      "projectUniqueName": "C:\\Users\\Steve\\source\\repos\\CompileAsDLLError\\CompileAsDLLError\\CompileAsDLLError.csproj",
      "projectPath": "C:\\Users\\Steve\\source\\repos\\CompileAsDLLError\\CompileAsDLLError\\CompileAsDLLError.csproj",
      "packagesPath": "C:\\Users\\Steve\\.nuget\\packages\\",
      "outputPath": "C:\\Users\\Steve\\source\\repos\\CompileAsDLLError\\CompileAsDLLError\\obj\\",
      "projectStyle": "PackageReference",
      "fallbackFolders": [
        "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
      ],
      "configFilePaths": [
        "C:\\Users\\Steve\\AppData\\Roaming\\NuGet\\NuGet.Config",
        "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
        "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
      ],
      "sources": {
        "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
        "https://api.nuget.org/v3/index.json": {}
      }
    }
  },
  "logs": [
    {
      "code": "NU1105",
      "level": "Error",
      "message": "Unable to read project information for 'CompileAsDLLError': Sequence contains more than one element"
    }
  ]
}
@3steve3 3steve3 added the t/bug Something isn't working label Oct 9, 2022
@3steve3 3steve3 changed the title Compileing as DLL with ApplicationDisplayVersion higher than 1.0 fails Compiling as DLL with ApplicationDisplayVersion higher than 1.0 fails Oct 9, 2022
@jsuarezruiz jsuarezruiz added the area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer label Oct 10, 2022
@rmarinho rmarinho added this to the Backlog milestone Oct 10, 2022
@ghost
Copy link

ghost commented Oct 10, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@rmarinho
Copy link
Member

Does this work on net6 ?

@3steve3
Copy link
Author

3steve3 commented Oct 10, 2022

I get same behavior in net6.0, so no.

@Jinjinov
Copy link

If I set ApplicationDisplayVersion to 1.0.1 and delete bin and obj folders it fails with

Error	NETSDK1005	Assets file '\obj\project.assets.json' doesn't have a target for 'net7.0-windows10.0.19041.0'. 
Ensure that restore has run and that you have included 'net7.0-windows10.0.19041.0' in the TargetFrameworks for your project.	
C:\Program Files\dotnet\sdk\7.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets	267	

If I delete bin and obj folders again and set ApplicationDisplayVersion back to 1.0 it works again.

@juanmalm
Copy link

Same issue here

@mattleibow
Copy link
Member

For now the easiest workaround is to add <Version>$(ApplicationVersion)</Version> in your project directly after your <ApplicationVersion>1.0</ApplicationVersion> property.

@samhouts samhouts modified the milestones: Backlog, .NET 8 Jun 7, 2023
@samhouts samhouts added the fixed-in-8.0.0-preview.5.8529 Look for this fix in 8.0.0-preview.5.8529! label Jun 21, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Jul 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer fixed-in-8.0.0-preview.5.8529 Look for this fix in 8.0.0-preview.5.8529! platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants