Skip to content

Is it possible to install Autofac 4.0 for UAP? #699

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

Closed
Belorus opened this issue Nov 22, 2015 · 13 comments
Closed

Is it possible to install Autofac 4.0 for UAP? #699

Belorus opened this issue Nov 22, 2015 · 13 comments

Comments

@Belorus
Copy link

Belorus commented Nov 22, 2015

Default project.json looks like that:

{
  "dependencies": {
    "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0"
  },
  "frameworks": {
    "uap10.0": {}
  },
  "runtimes": {
    "win10-arm": {},
    "win10-arm-aot": {},
    "win10-x86": {},
    "win10-x86-aot": {},
    "win10-x64": {},
    "win10-x64-aot": {}
  }
}

During installation of package via nuget i see many errors like this:

Restoring packages for \App2\project.json...
Version conflict detected for System.Diagnostics.Debug. 
 App2 (≥ 1.0.0) -> Autofac (≥ 4.0.0-rc1-177) -> System.Diagnostics.Debug (≥ 4.0.11-beta-23516) 
 App2 (≥ 1.0.0) -> Microsoft.NETCore.UniversalWindowsPlatform (≥ 5.0.0) -> Microsoft.NETCore.Runtime (≥ 1.0.0) -> Microsoft.NETCore.Runtime.CoreCLR-arm (≥ 1.0.0) -> System.Diagnostics.Debug (= 4.0.10).
@Belorus
Copy link
Author

Belorus commented Nov 25, 2015

http://stackoverflow.com/questions/33855314/how-can-i-update-one-specific-dotnet-assembly-in-universal-windows-platform-app/33902742#33902742 - this can help a bit during resolving dependencies conflict between UAP and Autofac

@Belorus
Copy link
Author

Belorus commented Nov 26, 2015

If i add beta runtime dependency i get following:

All packages are compatible with UAP,Version=v10.0.
System.Linq.Expressions 4.0.11-beta-23516 provides a compile-time reference assembly for System.Linq.Expressions on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x86.
Some packages are not compatible with UAP,Version=v10.0 (win10-x86).
System.Linq.Expressions 4.0.11-beta-23516 provides a compile-time reference assembly for System.Linq.Expressions on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x86-aot.
Some packages are not compatible with UAP,Version=v10.0 (win10-x86-aot).
Package restore failed for 'AutofacUWP'.

@alexmg
Copy link
Member

alexmg commented Dec 2, 2015

Any change in the situation with Visual Studio 2015 Update 1?

@Belorus
Copy link
Author

Belorus commented Dec 2, 2015

Upd1 didn't change anything.

But i've found a workaround.

  1. Install Microsoft.NETCore.Runtime 1.0.1-beta-23516 via nuget.
  2. Install System.Linq.Expressions 4.0.11-beta-23516
  3. Install Autofac 4.0.0-rc1-177

@ericstj
Copy link

ericstj commented Dec 9, 2015

Actually Autofac shouldn't be referencing those new package versions. System.Linq.Expressions 4.0.11-beta-23516 has no API changes over System.Linq.Expressions 4.0.10. Why reference the latest version?

@tillig
Copy link
Member

tillig commented Jan 7, 2016

Given we've got a bunch of package compatibility stuff we're already fighting through with the dotnet / netstandard TFM changes and portable class libraries, this pretty heavily overlaps with the discussion going on in #594, where we're tracking the overall conversion effort.

I'll leave this open to ensure we remember to test specifically on UAP, but it may be worth following that issue since we'll probably update things more often over there.

@tillig tillig changed the title Is it possible to install Autofac for UAP via Nuget ? Is it possible to install Autofac 4.0 for UAP? Jan 7, 2016
@JamesNK
Copy link

JamesNK commented Jan 14, 2016

I'm also getting this.

Severity    Code    Description Project File    Line    Suppression State
Error       System.Linq.Expressions 4.0.11-beta-23516 provides a compile-time reference assembly for System.Linq.Expressions on UAP,Version=v10.0, but there is no run-time assembly compatible with win10-x86-aot.         0   

Which is a problem because I'd like to update to 4.0 to fix CA errors #663

@ericstj
Copy link

ericstj commented Jan 14, 2016

@JamesNK can you share your project.lock.json? It seems like the runtime-linkage isn't happening. System.Linq.Expressions AOT implementation exists in runtime.aot.System.Linq.Expressions. So long as our runtime ID graph and lineup are part of your package closure (Microsoft.NETCore.Platforms) it should bring in the aot implementation.

@tillig
Copy link
Member

tillig commented Jan 14, 2016

I rolled back the System.Linq.Expressions dependency in the develop branch to 4.0.10 to see if that helps. It's published to the MyGet feed (https://www.myget.org/F/autofac/api/v3/index.json) as v4.0.0-rc2-185. Let me know if that helps. I tested it quickly myself as such and things build with no errors or warnings:

{
  "dependencies": {
    "Autofac": "4.0.0-rc2-185",
    "Microsoft.NETCore.Runtime": "1.0.1-beta-23516",
    "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0",
    "System.Collections": "4.0.11-beta-23516"
  },
  "frameworks": {
    "uap10.0": {}
  },
  "runtimes": {
    "win10-arm": {},
    "win10-arm-aot": {},
    "win10-x86": {},
    "win10-x86-aot": {},
    "win10-x64": {},
    "win10-x64-aot": {}
  }
}

@JamesNK
Copy link

JamesNK commented Jan 21, 2016

This project I'm using Autofac with has a lot of developers and I don't want to add non-standard feeds into the mix. I'll wait until it is on nuget.org

@tillig
Copy link
Member

tillig commented Jan 21, 2016

Is it possible for you to try it just temporarily so I can verify it's not "works on my machine?" If it works for you, I'll close the issue as fixed.

@JamesNK
Copy link

JamesNK commented Jan 21, 2016

It compiles. Ironically Code Analysis doesn't work anymore which is the reason I wanted to upgrade in the first place.

18>MSBUILD : error : CA0055 : Could not identify platform for 'Tests.exe'.
18>MSBUILD : error : CA0052 : No targets were selected.

@tillig
Copy link
Member

tillig commented Jan 21, 2016

Thanks for checking it out. I think I'll call this closed for now, but if you find this doesn't go away after all the tooling catches up to the name changes and everything else, we can revisit.

@tillig tillig closed this as completed Jan 21, 2016
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

No branches or pull requests

5 participants