Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
620 views
in Technique[技术] by (71.8m points)

nuget - Can I build an "old school" PCL with DNX/DNU?

In Noda Time 1.3.1, our .csproj file referred to Profile 328 and our .nuspec file put the results in

libportable-net4+sl5+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1+XamariniOS1

For Noda Time 2.0, I've moved everything over to DNX/DNU (soon to be dotnet cli, of course). However, we now want to build a regularly-updated package containing the latest time zone information from IANA. We'll build one version of that with a dependency on Noda Time 1.3.1, and another version with a dependency on Noda Time 2.0.0.

I would like to do all of this still within DNX/DNU, but it's unclear to me whether there's any way of telling DNX/DNU about this target framework. Note that I want to make this available to all current users of 1.3.1, and it also depends on 1.3.1, so I believe the set of target frameworks basically needs to be identical.

I've tried frameworks of:

  • portable-net40+sl5+win8+wpa81+wp8 (which I expected to have the best chance of working based on the Nuget documentation)
  • portable-net4+sl5+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1+XamariniOS1
  • Profile328

In every case, dnu restore shows an error of this form:

"portable-net40+sl5+win8+wpa81+wp8" is an unsupported framework.

I have a horrible suspicion that this basically isn't a supported use case, and that I'll need to stick to a regular csproj file for this particular part, but I thought it worth asking to see if I'm missing something.

question from:https://stackoverflow.com/questions/36148363/can-i-build-an-old-school-pcl-with-dnx-dnu

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

There's been some issues with Xamarin frameworks in the past, but try doing something like this;

https://github.com/AutoMapper/AutoMapper/blob/93f276fea36dedb2efd861096f881667af880d58/src/AutoMapper/project.json

See if this works:

{
  "frameworks": {
    ".NETPortable,Version=v4.0,Profile=Profile328": {
      "frameworkAssemblies": {
        ...
      }
    }
  }
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...