Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

project.json targeting net20 and net35 #1894

Closed
JamesNK opened this issue May 19, 2015 · 14 comments
Closed

project.json targeting net20 and net35 #1894

JamesNK opened this issue May 19, 2015 · 14 comments

Comments

@JamesNK
Copy link
Member

JamesNK commented May 19, 2015

I am attempting to use project.json to compile Json.NET and I discovered the framework targets net20 and net35 currently don't work. The assemblies referenced for those targets are always .NET 4.0.

project.json:
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll

Class library targeting .NET 2.0:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll

Also there are automatic references to assemblies that don't exist in .NET 2.0 like System.Core.dll

This is blocking me using project.json to compile all of Json.NET

@muratg
Copy link
Contributor

muratg commented May 21, 2015

@davidfowl

@JamesNK
Copy link
Member Author

JamesNK commented Jul 31, 2015

What's the plan here?

I'd like to switch over to project.json. It would simplify my build scripts, reduce the likely-hood of errors such as JamesNK/Newtonsoft.Json#618 and I could improve the features offered by Json.NET on vnext by using IL gen instead of expression trees for reflection.

Before you ask, I don't want to ditch net20 and net35. People do use them, and other packages depend on them. Glimpse for example is net35. Dapper also has old .NET builds and is waiting on this support - DapperLib/Dapper#241

@analogrelay
Copy link
Contributor

I think we can do this. It's just a matter of expanding our set of known frameworks and reference assembly folders. I'll leave it to @muratg to schedule, but we can try to do it in beta7. It may not make it, but I think it'll be fairly straightforward so I'm OK trying to take it on for b7.

@JamesNK
Copy link
Member Author

JamesNK commented Aug 11, 2015

@muratg Will this make beta 7? 😄

@analogrelay
Copy link
Contributor

+@Eilon (as @muratg is on vacation)

@Eilon
Copy link
Member

Eilon commented Aug 11, 2015

@anurse let's chat tomorrow on what this would take. We have a design mtg at noon. Let @glennc know we ought to discuss this.

@analogrelay
Copy link
Contributor

We should be able to do this for beta8, it should just be a matter of searching the correct GAC paths. If it turns out to be more work, I'll circle back to this thread for an update.

@JamesNK
Copy link
Member Author

JamesNK commented Aug 20, 2015

Can you point me towards instructions for getting this before beta 8?

@analogrelay
Copy link
Contributor

It should be on the aspnetvnext feed now, just dnvm upgrade -u (make sure your NuGet.config also points to https://www.myget.org/F/aspnetvnext/api/v2 and you have the latest beta8 builds of any DNX packages, if you reference them)

@JamesNK
Copy link
Member Author

JamesNK commented Aug 21, 2015

Bug:

System.Data.Entity (and other 3.5 references) resolves in .NET 2.0 when it should fail.

Name: fx/System.Data.Entity
Path: C:\Windows\assembly\GAC_MSIL\System.Data.Entity\3.5.0.0__b77a5c561934e089\System.Data.Entity.dll

    "net20": {
      "frameworkAssemblies": {
        "System.Core": "",
        "System.Data": "",
        "System.Runtime.Serialization": "",
        "System.Xml": "",
        "System.Web": "",
        "System.Web.Extensions": "",
        "System.Data.DataSetExtensions": "",
        "System.Data.Entity": "",
        "System.Drawing": "",
        "System.ComponentModel.DataAnnotations": ""
      },
      "dependencies": {
        "NUnit": "2.6.4",
        "FSharp.Core": "4.0.0.1"
      }
    }

@analogrelay
Copy link
Contributor

That's a valid issue. Is it blocking your scenario? I would assume that if it is supposed to fail you can unblock yourself by just not referencing it :). Can you file an issue about it? The problem is that we're resolving out of the GAC as well as the Framework Reference Assemblies and aren't checking the GAC reference to see if it is compatible.

@JamesNK
Copy link
Member Author

JamesNK commented Aug 22, 2015

It's not blocking.

@JamesNK
Copy link
Member Author

JamesNK commented Aug 22, 2015

Overall it appears to be working pretty well. Xunit is giving me an exception with the latest DNX build. Is that expected?

@davidfowl
Copy link
Member

You need to use the new xunit runner on their myget to use beta8

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants