Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Ochowie
Nov 9, 2007

Does anyone have any good SignalR resources? Or has anyone used SignalR and can provide some feedback? I'm trying to send messages with different subsets of a dataset to different clients and I'm not seeing any good guides on how to do that. As an example, I'd like to update stock quotes only for stocks in a given clients portfolio rather than just send all stock quotes and have the client decide which ones to display. I'm not sure that SignalR is the right method for this task but I wanted to play around with it and this seemed like a decent learning application to try.

Adbot
ADBOT LOVES YOU

Ochowie
Nov 9, 2007

seregrail7 posted:

I've worked on something similar where I need to push out data from a data set where it's different content for each user. What I did was treat the user as a group using their ID as the group name and then build up the data that they should see and send just that in the update(I presume if you're dealing with user portfolios you have what they should see stored some how). You will be repeating some of the data you send out for sure but it was the least messy method I could come up with. I set up a Hub to deal with security for users connecting and handling all the updates to the dataset since it's all data that's constantly changing.

You can read more about Hubs here: http://www.asp.net/signalr/overview/signalr-20/hubs-api/hubs-api-guide-server

My system only has about 30 users currently though so I have no idea if it will scale up well.

How did you keep the service alive to push changes to users? All of the examples that have used timers have been for SignalR 1.0 which registered the service in global.asax to keep the service alive. The 2.0 examples using OWIN startup seem to use RX. Ideally though, I'd like it not to be timed. As in I get a message with a quote tick that pushes to the hub/persistent connection which pushes to the client. However, it seems like SignalR doesn't support that or my RX skills aren't very strong.

Ochowie
Nov 9, 2007

seregrail7 posted:

It was SingalR 1 that I used and I followed this guide: http://www.asp.net/signalr/overview/signalr-1x/getting-started-with-aspnet-signalr/tutorial-server-broadcast-with-aspnet-signalr

Essentially you create a Broadcaster that's a Singleton which holds onto all the information while your Hub just tells it about new connections etc.

Hey thanks. I think that example would be better to carry over into SignalR 2. Previous articles I read seemed to require a timer to be a registered object to keep the server alive which I'm not sure if I can do in SignalR 2.0 since it's not activated through a global.asax. I'm still playing around with setting up a pub/sub message bus because that would seem to fit a true quote stream scenario better than a timed update, but this is a good start too.

Ochowie
Nov 9, 2007

Volte posted:

There is strong reason to believe that Xamarin will be part of Visual Studio in the not too distant future, so there's still hope.

Yep. There were some acquisition rumors in the spring. Nothing recently though but it would make sense. I wonder if they'll include it in the base Visual Studio license or it will still be a additional license to buy.

Ochowie
Nov 9, 2007

Ithaqua posted:

It's an event handler, so it can't return a Task.

Let's say I have this pseudo-pseudocode:

code:
public class MyHub : Hub 
{
    public MyHub() 
    { 
        var eventyThing = new EventyThing();
        eventyThing.SomeEvent += ThingyHandler;
    }

    public async void ThingyHandler(object sender, EventArgs args) 
    {
    }
}
ThingyHandler will never be invoked. In fact, I'm pretty sure it's failing catastrophically behind the scenes -- everything after the event invocation doesn't occur.

[edit]
Basically, I'm writing a multiplayer, multi-instance turn-based game. I want the game instances to fire events when certain actions occur internally (for example, "round timeout expired, anyone who hasn't played this round yet can get hosed") so the clients can be notified. I don't want to pass an instance of the HubContext into the game objects, because that would violate the poo poo out of separation of concerns -- the game should be responsible for maintaining its internal state, and the hub should be responsible for figuring out what data to push to connected clients based on how the game's internal state is changing.

Could you drop this out into a thread-safe helper class? That's how I've been working with hubs and I'm able to trigger async void events for timer ticks and such.

Ochowie
Nov 9, 2007

Ithaqua posted:

Could you give me a 10-line repro of what you're talking about? I tried something similar last night with no luck, but I may have been missing something because I was doing it after driving for 3 hours.

I'm probably going to end up passing callbacks in like Bognar suggested. It'll bloat things slightly, but not terribly. And I don't think I need multicasting, so it should be more or less functionally equivalent.

I basically used the StockTickerHub example and changed it to meet my needs:

code:
public class StockTickerHelper
{
        private readonly static Lazy<StockTickerHelper> _instance = new Lazy<StockTickerHelper>(
            () => new StockTickerHelper(GlobalHost.ConnectionManager.GetHubContext<StockTickerHub>().Clients), true);

        private Timer _timer;

        private StockTickerHelper(IHubConnectionContext<dynamic> clients)
        {
            Clients = clients;
        }

        public async Task<Quote> Start()
        {
            _timer = new Timer(UpdatePrices, null, 20000, Timeout.Infinite); 
        }

        private async void UpdatePrices(object state)
        {
           var results = await Task.WhenAll(quoteTasks);
        }
}
Then in the hub

code:
public class StockTickerHub : Hub
{
        private readonly StockTickerHelper _stockTickerHelper;
        private string _symbol;

        public StockTickerHub() : this(StockTickerHelper.Instance) { }

        public StockTickerHub(StockTickerHelper stockTicker)
        {
            _stockTickerHelper = stockTicker;
        }
}
Not listed here but the helper class is the one that sends the messages to the client using the context it pulls in the constructor.

Ochowie
Nov 9, 2007

Can anyone point me in the right direction with the Identity framework for Web API services? I have the authentication piece set up using OAuth bearer tokens, but I need help on setting up user based authorization. I would like to make sure that a user has access to their own data and no one else's. However, when using bearer tokens the user name is never sent to the service and I Identity.Name is blank. I'm wondering how I would send along a User name and validate it against a token (or password if token's aren't the right approach) so that a user can only access their own data. I don't have much experience with security and this is for a personal project that I'm doing to learn a bit more.

Edit: I recreated the project with the individual user account authorization and now I get a username generated from the bearer token. I was creating basic authentication from scratch using a tutorial I found related to angular online but it wasn't embedding the username in the token. As a side note, does anyone find it annoying that Visual Studio won't allow a Web API project to be created without including the MVC component? You can create an empty project but then it won't allow for an authentication setting otherwise you need to create a joint Web API MVC project. I had to clean out all of the MVC stuff after the project was created which was pretty annoying.

Ochowie fucked around with this message at 17:32 on Sep 10, 2014

Ochowie
Nov 9, 2007

RangerAce posted:

Yes! It is very bad, almost all the time.

This is one of the better write-ups on the subject: http://raganwald.com/2014/03/31/class-hierarchies-dont-do-that.html

It mainly is written at javascript devs, but the general principles are sound.

From your Link posted:

In theory, JavaScript does not have classes. In practice, the following snippet of code is widely considered to be an example of a “class” in java script:

I think you're underestimating the extent this is written for JavaScript devs...

Ochowie
Nov 9, 2007

Cross posting from an SO question I started. Is there any way to simulate foreign key checks when unit testing a Repository on top of EF using Moq? I have the following code which should technically fail because one of the relationships isn't present in either the database or the mocked sets on the context. I have the following code which I would expect to fail because the foreign key reference is not in the context but it succeeds adding and verifying that SaveChanges() is called on the DbContext.

code:
var entitySet = new Mock<DbSet<MyEntity>>();
var mockContext = new Mock<MyContext>();
mockContext.Setup(x => x.Set<MyEntity>()).Returns(entitySet.Object);
var myentity = new MyEntity
{
    RefID = "ABCD", //Foreign Key that does not exist in the context
};

var repo = new MyRepo<MyEntity>(mockContext.Object);
repo.Add(myentity);         

//repo.Add()
public void Add(TEntity entity)
{
    DbSet.Add(entity);
    context.SaveChanges();
}
Since repo.Add() is successful even though it fails using a live database I'm not sure how the unit test is useful at all.

Ochowie
Nov 9, 2007

gariig posted:

How would a fake DbContext know that your relationship should fail? It's just going to let your code call into it, return pre-recorded behavior (Setup/Returns), and to allow you to Verify calls. If you want to test what happens when your code gives a bad relation you can have Moq throw an exception.

What you want is an integration test where you aren't mocking your DbContext but using a MyContext against a real database.

The Art of Unit Testing is a great book that goes over unit testing and touches on integration testing.

I guess I assumed that if I mocked up the DbSets and passed them to the context that some of the context behaviors would carry over. I guess that that doesn't make a lot of sense. I guess I'm more familiar and comfortable with the integration testing concept over the unit testing one. Thanks for the reading recommendation.

Ochowie
Nov 9, 2007

gariig posted:

It depends on what you want to test. I've honestly not done much EF. Can you mock a DbContext and still get information like invalid FK like Ochowie wanted? I'm too lazy to go look up the information.

To your point about integration tests being hard. They are and might not be worth the effort. Depends on the code base

I could see some uses for it. Certainly for simulating queries or other downstream logic, or for testing error handling like RICHUNCLE mentions. It seems like unit testing a repository add method doesn't seem like it adds much value without FK checking. Originally, I foolishly thought that any non-mocked methods would revert to their regular implementation. Also, I thought that FK checking would be done by the DbSet add method instead of the SaveChanges.

Ochowie
Nov 9, 2007

So I have an f# question. Has anyone done pattern matching on .NET types using the :? operator? I'm using f# to do some financial calculations on a list of various types derived from a base class and calculations need to be performed based on the derived type. I could give each of them a calculate method and use polymorphism but I was intrigued by the ability in f# to pattern match on type.

Ochowie
Nov 9, 2007

Destroyenator posted:

It works pretty much like you'd expect but stylistically it sounds like this is when you should use polymorphism.

I know I should, but these are POCO EF entities and I feel dirty putting what is essentially business logic right on the entity class. Transferring them to DTOs would essentially require the same kind of type checking since i would get a list of base objects and want map them to a list of DTOs.

Ochowie
Nov 9, 2007

Destroyenator posted:

Well you know the codebase better than any of us and it's partly a personal preference thing, try it out and see how it feels? Think about how often a new sub-type will be written, how many different places you'll need to put switching logic and whether you're setting a precedent (either way).

Yeah this is just a personal project I'm doing for learning purposes. Part of what's bugging me is that using polymorphism with a calc method on each object seems the most obvious but it introduces weird object dependencies that I don't like and I've been struggling for a clean way of processing a heterogeneous list of derived objects in this case and the f# pattern match seems like an interesting solution.

Ochowie
Nov 9, 2007

GrumpyDoctor posted:

Is there a way to use discriminated unions? One option would be to create a union parallel to the class hierarchy, which is kind of a smelly duplication of work but moves the potential runtime error to a compile-time one.

I've thought about that since I want to play around with some concepts from a paper on financial contract combinators. Buy wouldn't I still need to pattern match the original type to create the union type?

Ochowie
Nov 9, 2007

Mr Shiny Pants posted:

If you are using F#, why not use a Type Provider instead of EF? Honest question.

I guess I could. I started with EF to do CRUD type stuff for this project so that was there before.

Ochowie
Nov 9, 2007

This is from a few pages back, but what is the difference between VS Community and Pro? On the Website it says it's a version of the Pro products optimized for small teams but I'm not sure what that means. Are there features that are left out or are they realigned to support smaller teams?

Ochowie
Nov 9, 2007

crashdome posted:

I develop entirely on a Surface Pro 2 (1920x1080 10.6" screen). I have a separate 21" monitor on a workbench which helps a little when I'm debugging but, I get by.

I love it because application development is a secondary task for me and I can work on things when I'm on the bus or in-between other things at a café or whatever.

It's a whole different world from having dual monitors and a really fast PC to develop on but, if you are going to be dragging around a mobile 17" laptop because you want screen real estate you might want to consider where you are going to prop that sucker up. You'll need to constantly plug it in, have room for a mouse, etc..

Prior to the Surface, I developed on a 13.3" Fujitsu convertible. That thing was a beast compared to newer tablets/Surface Pros and being a mobile user, I never want to buy another full size laptop ever again. I can deal with not having dual screens if it means I'm not humping a gigantic rucksack full of gear everywhere.

edit: Seconding that you need an SSD no matter what. Especially if you are bouncing between other applications during development

edit2: Those Surface Pro 3s are pretty effing light. You should buy one and make me super jealous

edit3 - last one I promise: So I just found out I can use my crappy 7" android tablet as a possible second screen using iDisplay and a hidden ad-hoc WiFi signal. Lol, I'm going to buy every cheap tablet on craigslist I can find to make some weird fold out portable Franken-display.

I've really been trying to get my work to give me a Surface Pro 3 instead of our lovely HP laptops. I already have daisy-chained display port monitors so I could use the dock that they sell as an accessory. I really want it for the active digitizer. I can't believe Apple hasn't given in on that for the iPad.

Ochowie
Nov 9, 2007

crashdome posted:

I'm pretty sure its because the usefulness would be limited. It's not like you can run full Photoshop on the iPad. Even on the surface it's not my go to input device. It's pretty rad to bust out the stylus and collapse the keyboard once in awhile though.

Not to go on too much of a derail of the thread but I just want to take notes on the iPad. There are such great note taking apps but all the stylii suck with writing with your finger being the only thing worse. The reason they haven't done it is because Steve Jobs hated stylus based navigation, but I don't think anyone is asking for that.

Ochowie
Nov 9, 2007

Bognar posted:

Wow, what design decisions were made there that caused generics to be slower? I thought C# generics were just syntactic sugar for the compiler to create additional classes at compile time. There shouldn't be any reason that those are significantly slower (I say from my armchair).

I was about to ask the same thing. Are there any articles that back this up? This seems really bizarre to me. Hopefully it changes when MS sacks up and buys Xamarin.

Ochowie
Nov 9, 2007

Gul Banana posted:

Yeah, I had a conversation with David Fowler. He stated pretty clearly that they're not going to support languages other than C# in KRuntime projects (actual asp.net sites and new-style class libraries).
This issue got me interested: https://github.com/aspnet/Home/issues/236

@davidfowl confirmed no vb support, and that also if those extensibility points do get created, they won't be used by Microsoft for vb support. However, they do intend to provide some way to reference projects written in VB/C++CLI/etc FROM asp.net projects, certainly if you're targetting the desktop .NET framework and "not yet" otherwise. Right now, referencing VB projects isn't working even for targeting net45, but they will definitely support at least that much.

I haven't used VB since v1 of the .NET framework before I learned C#, but drat that is an incredible departure from the original principles of the .NET framework.

Ochowie
Nov 9, 2007

Gul Banana posted:

The impression I got from talking to some of the developers was that they're committed to enabling things which were just impossible before - side by side installs, cross-platform support, fine-grained versioning (and therefore first-class package management). In order to do that, they're making sacrifices. In a way, it's the same old Microsoft story - reaching for the markets you *don't* have, because that's where the growth is! Still, I don't think they've made a bad decision overall. The combination of the new runtime and new build systems really open up the possibilities for .NET, and the old stuff will work 'forever' in the same sense that e.g. winforms and webforms are still supported today.

Going single-language in particular... I'm less convinced of the wisdom there. Although personally I'm going to take the chance to jump to the ship I wanted anyway, I think they've been misled by their target audience. When the open source and web development communities talk about this stuff, they think of C# as .NET - the news of VB being dropped hasn't really got out in a big way, but there will be segments for whom it is not news at all. A lot of people just do not even know why VB.NET exists (or even understand how little related it is to VB6). So there's a loop there - the K team are making their own lives a lot easier and the early feedback tells them they're doing 100% fine.

Meanwhile, where .NET is used today is largely enterprise - it's big! Not as big as Java, but still big. And very lucrative. And those people have a *lot* of VB code, or in some cases more esoteric stuff like: financial systems in F#, interop in C++/CLI, scripting whatnots in IronPython. This is a huge audience which is just going to be cut off from the new world - at least, the web development part of the new world. It only makes sense if Microsoft have judged that those legacy desktop and server systems would have to be rewritten rather than ported *anyway*. I'm sure in many cases they'd be right.

Of course, it's all a bit confusing because there's some internal misalignment going on. The compiler people seem to like multiple languages just fine, and VB's supported in Roslyn and in Universal apps...

It seems like Microsoft is trying to reach out to an audience that will never accept it. I'm just not sure how much the open source/web development community is going to embrace these technologies as long as it has Microsoft associated with it. As a C# user (hell, I don't even remember VB.NET syntax well enough to write it right now) I see a lot of benefit to this approach as well, however, as an F# user I am really sad that they're not including it (demonstrating once again its second class status). At the risk of sounding hysterical, how log before .NET core ditches C# for Typescript to continue chasing this community of developers that will never give it the time of day?

Ochowie
Nov 9, 2007

Bognar posted:

I consider the annoying squiggles a feature - just fix whatever is causing your squiggles or turn off that inspection rule if you don't care about it. There's nothing I enjoy more than turning that ReSharper box in the top right into a green check.



Oh yeah... that's the good stuff.

I've posted this in the IDE thread for other JetBrains products and it's valid here too. I find their default validations to be way too aggressive. Things like typo checks should not be on by default (in my opinion). Also, some of the loop to linq conversion suggestions don't make a whole lot of sense and often produce code that is less clear (again in my opinion). It has a lot of useful tools but I wish it wasn't so in my face about certain things and I don't need to hunt around and turn things off individually.

Ochowie
Nov 9, 2007

bpower posted:

I love the x to linq stuff, it basically taught me linq with zero effort on my part.

Nothing against you personally, but that's why I would prefer that feature by disabled by default.

Ochowie
Nov 9, 2007

This might be a dumb question but what's the intended deployment scenario with ASP.NET 5.0 (previously vNext)? The documentation states that it can be self hosted or hosted in IIS. So that leaves me wondering if the intended Mac and Linux deployment scenario is really supposed to be the self hosting approach. I always thought this sort of thing was for development and debugging only (kind of like Flask self-hosting) and that production should go through Apache or NGinx or something.

Ochowie
Nov 9, 2007

RangerAce posted:

Is "self-hosted" a euphemism for "hosted on OWIN"?

I guess. They didn't call OWIN out by name but I guess that's what it would be.


Gul Banana posted:

they're writing a libuv-based http server named Kestrel
put it behind nginx and it's no worse than how people host a lot of random stuff

Interesting. I'll dig around for that.

Ochowie
Nov 9, 2007

I've started playing around .NET Core and ASP.NET 5 on Linux and I've run into some issues/confusion. The thing I'm confused about the most is the difference between DNX and .NET Core (as executed by the dotnet command). I tried running the sample hello world application using just .NET Core (I think) on Ubuntu 15.04 and it failed because it couldn't find System.Console (which is a known issue). However, if I run the same setup using DNX it works without issue. So my question is, which framework is DNX using in the background? Is it it my Mono install or is it still using .NET Core but accessing it in a different way? It's also possible that I'm totally offbase with this. This is the project.json for reference:

code:
{
    "version": "1.0.0-*",
    "compilationOptions": {
        "emitEntryPoint": true
    },

    "dependencies": {
        "Microsoft.NETCore.Runtime": "1.0.1-beta-*",
        "System.IO": "4.0.11-beta-*",
        "System.Console": "4.0.0-beta-*",
        "System.Runtime": "4.0.21-beta-*"
    },

    "frameworks": {
        "dnxcore50": { }
    }
}

Ochowie
Nov 9, 2007

EssOEss posted:

The way I think about it is that .NET Core is a set of interfaces/APIs that are exposed by various products called CoreFX (often used with the DNX runtime; which... I think... is the same as CoreCLR) and the Base Class Library (often used with the .NET Framework runtime). To "run something with .NET Core" makes no sense to me - it is not a piece of software, though it is implemented by various pieces of software.

Just my two cents; I am not comfortable enough with the topic to be able to help you out any more or to really commit to this interpretation!

I guess then my question would be, what's the difference between executing something using the dotnet run command vs. through DNX. I assumed that the dotnet version always invokes CoreCLR while DNX is more of an abstraction that could use different versions of the CLR in the background. The interesting thing is, I checked which runtime DNX was using (via DNVM) and it was previously using Mono. After I changed it to use CoreCLR my hello world application still ran correctly. So it leaves me even more confused about why it would run using DNX but not using the dotnet command.

Ochowie
Nov 9, 2007

Ithaqua posted:

mintskoal posted:

Let's hope it's more of an app store or something for extensions instead of ads.

I'm 100% certain that's the case.

Even so, paying upwards of $1000 and then seeing ads is ridiculous. Same with Azure. If Google can make a basically ad free experience in their cloud platform why can't Microsoft?

Ochowie fucked around with this message at 07:41 on Jan 22, 2016

Ochowie
Nov 9, 2007

uncurable mlady posted:

Because Microsoft is run by insane howling gibbons who demand maximal revenue from every possible source.

So much for the new Microsoft.

Ochowie
Nov 9, 2007

epalm posted:

That new Microsoft release candidate that supposedly runs on Linux is probably not the thing you want.

(I'm not saying it won't work, but based on your requirements I would probably go the tried/tested route, using the least number of unknowns.)

Edit: unsolicited rant:

At some point in the last couple years, I've stopped cleverly "hacking" on things.


Who is going to maintain that mess when you quit or die? Sometimes "boring" is the right thing to do. Especially at your day job.

It seems like now is a particularly bad time to try this out since it's being migrated from running on DNX/DNVM to the new dotnet CLI. It seems like it would make sense to wait a bit for RC2 to come out and be more or less stable before trying this.

Ochowie
Nov 9, 2007

xgalaxy posted:

Jet Brains C# IDE is out for early access (aka beta). I'm excited to check it out. While running Visual Studio on OS X via parallels is an okay experience it would be nice to have something that offers a bit of a smoother ride performance wise. I hate MonoDevelop. I've used IntelliJ before and loved it for Java programming.

I'm curious how this will play out in the long run. They've built it as a wrapper around calls to Resharper which seems a bit different from their normal IDE's.

Ochowie
Nov 9, 2007

Drastic Actions posted:

It's called Project Rider.

And I would say if you haven't used Xamarin Studio recently, maybe check it out again. My biggest issues with it are with our web development stack (which have been unloved for years). If you want to do ASP.NET or anything like that, I would stick with VS Code. There are addons for ASP.NET core but... Yeah, not very useful IMO :(. But besides that, the debugger has gotten better, rosyln support is sweet, I like the F# support and building out Mac apps with it is cool. I'm slightly biased, but I think it works well. It's more useful than just writing Xamarin apps on Mac with it.

Rider doesn't support .NET core yet...

Ochowie
Nov 9, 2007

Inverness posted:

Plorkyeran posted:

From what I've heard it was a very :microsoft: project where the VS team was forced to start using WPF despite hating it, ran into a huge number of problems, and then had to fight hard to get any of them fixed.
I suspect many of the performance optimizations in WPF are because of the VS team cracking skulls.

I remember reading that they had to do a bunch of really ugly hacks to get WPF to work on a project as large as Visual Studio.

Ochowie
Nov 9, 2007

Inverness posted:

I want to know more about this. :allears:

I can't find the original source but here https://www.youtube.com/watch?v=aWqg55ejoss is a video about the migration.

Ochowie
Nov 9, 2007

I'm playing around with .NET on Linux and I'm wondering how to import a locally built class library into another project. I'm trying to import a dependency that can be built with .NET core but the nuget package hasn't been updated to support core yet.

Ochowie
Nov 9, 2007

Gul Banana posted:

there's an imports: key available in project.json which lets you override what a package claims to support. use with care though, bc if it really isn't compatible you're in for a runtime crash

Yeah, that's part of the problem. I don't think the version that's on NuGet will work with core. However, the version that I built from Github does. I just don't know how to integrate that version.

Ochowie
Nov 9, 2007

Gul Banana posted:

oh! right. if you built it in the same solution, you can reference it as a dependency with {"target": "project"} instead of a version number (in visual studio the gui will let you do this via 'add reference'). otherwise, dotnet pack/nuget pack it into a nupkg and put that in a local folder package source or on myget or something.

Thanks for this. So I ran dotnet pack on the repo, but I can find the nupkg anywhere. Do you know where it outputs to? I'm thinking part of the problem is that this library technically compiles for .net standard instead of .net core so I wonder if that's what is tripping me up?

Edit: Also, what is the connection between applications targeting the .NET Standard and .NET Core? Can I use a .NET Standard library from a .NET Core app? Also, I can't seem to make a .NET Standard console application (maybe that's because I'm running a version of Linux, Ubuntu 15.10 that's not supported by .NET Standard?).

Ochowie fucked around with this message at 22:36 on Jul 14, 2016

Ochowie
Nov 9, 2007

Gul Banana posted:

netstandard is for libraries only, not apps. it's like an interface which is implemented by actual platforms, of which .net core (netcoreapp) is one.
for example, netcoreapp1.0 implements netstandard1.6; .net 4.6.1 (net461) and UWP both implement netstandard 1.4. so a library built for netstandard1.4 would support all three, but one built for netstandard1.6 would only support .net core.

docs: https://github.com/dotnet/core-docs/blob/master/docs/core/tutorials/libraries.md

Thanks for this. Am I correct in assuming that libraries anything that can build to netstandard <= 1.6 can be used by a netcoreapp1.0 console application? I've run into something strange where the library I'm trying to build from source targets netstandard1.5 but depends on a library that isn't supported by netcoreapp1.0 (IX-Async) and I'm not sure how that's possible?

Adbot
ADBOT LOVES YOU

Ochowie
Nov 9, 2007

Gul Banana posted:

your understanding of netstandard is correct. it's possible the author of the library used imports.. do you have source somewhere?

You mean in the Frameworks section? If so, then yes, it imports portable-net45.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply