|
Ithaqua posted:If you're doing true CI, I strongly recommend hooking up an on-prem CI solution. Team Build will of course work just peachy with VSO, as will Jenkins and TeamCity.
|
# ¿ Jun 30, 2014 16:38 |
|
|
# ¿ May 2, 2024 00:36 |
|
You might want to look into cache control headers so repeated page views from the same client won't need to hit your server. Check out the OutputCacheAttribute. Also look at what EF is running to grab the content. SQL Express Profiler is free and can tell you what SQL is being executed. If the database is what's slowing everything down you might need to address what EF is generating or whether you need indexes in the database.
|
# ¿ Jul 9, 2014 11:50 |
|
Geisladisk posted:Does anyone have any tips for streamlining Windows Service development? Depending how much scope you've got to mess with them I've used http://docs.topshelf-project.com/en/latest/overview/faq.html before and it's pretty good. You write your service as a console app with this wrapping it up. Lets you run from the command line for testing and adds install/uninstall command line flags which do that junk for you.
|
# ¿ Jul 22, 2014 16:44 |
|
Re: ELMAH alternatives: I've used StackExchange.Exceptional and it's pretty good. Stacks repeated exceptions so it's easy to read but will throw away some info in that case (only keeps the http context data for the first one etc.). Less configurable than ELMAH but it's easy to throw custom data into it along with the exceptions. I haven't used it but I've heard good things about Serilog.
|
# ¿ Aug 14, 2014 14:58 |
|
Ithaqua posted:Something I was thinking about earlier: I'd consider who's on my team and who's gonna be supporting it because I wouldn't mind either way but there are people that would care *really hard* about it, and you could be setting a precedent.
|
# ¿ Aug 21, 2014 03:50 |
|
Ithaqua posted:If you want to stay in the Microsoft stack and keep it simple (and can afford licensing costs), MS Release Management fits the bill. It can kick off a custom workflow-based deployment sequence, a DSC script, or Chef.
|
# ¿ Sep 14, 2014 05:55 |
|
Ithaqua posted:RM... Green_Machine posted:There's a framework ideal for writing scenario-based BDD-style unit test that ties into MSTest. It's called Given.
|
# ¿ Sep 14, 2014 15:01 |
|
Scaramouche posted:I think this is possible, but I was wondering if you guys could give me a direction to get started. I've got a large number of images provided by a third party. Some of them are either contrasty, adjusted poorly, or what have you. This means that backgrounds that should be white, are instead kind of an off-white. Here's an example image: If you are going .Net, I'd just fire up nuget, search for image processing, filter by popularity and start googling library names until I found one that looked right. The other thing to consider is whether the "blended" bits where the background meets the item are going to look okay. Try paint bucket fill on a few with the more "off" backgrounds and see if it's noticeable. If you need those bits converted properly I think you might be heading into script photoshop/gimp territory unless a there's a library that explicitly does this.
|
# ¿ Oct 10, 2014 01:23 |
|
Ochowie posted: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. code:
Destroyenator fucked around with this message at 13:25 on Oct 14, 2014 |
# ¿ Oct 14, 2014 13:22 |
|
Ochowie posted: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.
|
# ¿ Oct 14, 2014 15:41 |
|
You're right, they do create new arrays. If it's only when you're debugging it sounds like the "Locals" window or something in VS is trying to read something it shouldn't? Side note: you can collapse your choose to a filter if you want: Array.filter (not << System.String.IsNullOrEmpty)
|
# ¿ Oct 20, 2014 06:56 |
|
Yeah, sorry I could've been clearer, the << operator is function chaining, it's just a terser way of writing: Array.filter (fun x -> not (System.String.INOE(x))) Where "not" is just the boolean not like "!" in c#.
|
# ¿ Oct 20, 2014 07:35 |
|
chmods please posted:Aren't those array functions evaluated lazily? I wonder if stepping through in the debugger forces an evaluation and you wouldn't otherwise see it in normal execution for a while. Bognar posted:I wish C# has this kind of composition. I love that you can do .Where(string.IsNullOrEmpty) but I hate that you have to do .Where(x => !string.IsNullOrEmpty(x)).
|
# ¿ Oct 21, 2014 03:05 |
|
ljw1004 posted:NameOf operator - https://roslyn.codeplex.com/discussions/570551 eg. nameof(SomeClass.Property.InnerPropertyName) I'd probably use them when constructing web forms that post back different view models.
|
# ¿ Oct 25, 2014 04:09 |
|
Che Delilas posted:I'll keep AutoMapper in mind - this project is pretty simple, so I'm happy just manually creating all my viewmodels, but I've seen it mentioned before a number of times as a real energy saver.
|
# ¿ Nov 27, 2014 10:38 |
|
Funking Giblet posted:I think you're missing something major! You can validate the configuration at runtime which will find unmapped fields, or write a unit test to do as much. Not to mention injectable value and type resolvers which can be reused across types. I guess I haven't seen it work out simpler in the long run (though I've only really seen it used extensively twice), but if it works for you great.
|
# ¿ Nov 29, 2014 07:01 |
|
Try to get the responsibility for reviews to be shared by the whole team. You don't want to end up as a "gatekeeper" or seen as a blocker to code getting to production. The team should be responsible for code quality. In reviews just make sure you aren't too hard (especially early on). You're looking for acceptable not perfect. Even if no code is changed as a result of reviews you'll be getting benefits from better visibility of the code base and what your colleagues are doing day-to-day.
|
# ¿ Dec 2, 2014 06:00 |
|
chmods please posted:I'm using Autofac with an MVC project. I need to provide a value from HttpApplication.Request to the container - it needs to be used elsewhere in the hierarchy, possibly from components which don't know anything about ASP.NET. Something like: You may have to add the Autofac.Mvc package if you haven't already.
|
# ¿ Dec 8, 2014 06:57 |
|
Dromio posted:We’ve had an issue where we changed our deployment to support testing an upcoming release in development and QA, but then had to re-deploy the older Production build and couldn’t without a good deal of work. If you run into similar again one way of mitigating a bit is to just add new tags to your servers and target the new steps to them. If there's no servers matching those tags in production those steps can be skipped. You might be able to target config transforms to tags as well but I'm not 100% on that.
|
# ¿ Dec 12, 2014 07:15 |
|
You may also run into the browser/webserver/load balancer/cache/whatever limiting your max URL length.
|
# ¿ Jan 30, 2015 13:17 |
|
aBagorn posted:Follow up, so if I'm reading these correctly, EF does NOT by default lock DB rows? What migration strategy will you be using, and how does the DBA feel about that? edit: that's a context per web request, not DB request.
|
# ¿ Feb 10, 2015 03:13 |
|
Does anyone know of a simple web monitoring/reporting tool I can plug into an MVC site? I just want basic stuff like request times and maybe SQL timings, what MiniProfiler does essentially but rolled up over all users and with a simple admin screen for monitoring hosted within the same app. I could build my own, either timing begin request to end request or just reading IIS logs, but it seems like this should be a simple thing someone's built?
|
# ¿ Feb 12, 2015 07:00 |
|
Mr Shiny Pants posted:This has stumped me for awhile: code:
|
# ¿ Feb 17, 2015 13:53 |
|
Yep.https://github.com/dotnet/coreclr/blob/02084af832c2900cf6eac2a168c41f261409be97/src/mscorlib/src/System/Globalization/DateTimeParse.cs#L2484 posted:
|
# ¿ Mar 5, 2015 01:45 |
|
What is your ideal/required process for versioning and QA?
|
# ¿ Mar 27, 2015 01:07 |
|
xgalaxy posted:What does everyone suggest for good code coverage tool?
|
# ¿ Apr 9, 2015 04:30 |
|
It's also useful for moving data between your objects and generated classes for messaging/remote services/etc. Never bothered looking into performance though.
|
# ¿ Apr 10, 2015 03:22 |
|
Yeah, I definitely agree with that sentiment. Closing streams they didn't open isn't a great pattern and I've hit it a couple of times.
|
# ¿ Apr 24, 2015 11:15 |
|
With Reshaper you can use Alt-End for go to derived class which works on interfaces.
|
# ¿ Apr 27, 2015 07:07 |
|
I've used a similar pattern of query/command on a few projects, it's worked really well and how big you make the infrastructure is up to your needs. I got fairly far with a really simple implementation in one case, along the lines of: C# code:
C# code:
The controllers end up being fairly declarative and readable too: C# code:
|
# ¿ Apr 30, 2015 11:08 |
|
I tend to avoid property injection too. I would only use a base class with injection for a base Controller in MVC/WebAPI where you know you're always going to want a RoleService or UserRepo or something in almost every action, and they all have a common base class anyway. In that case I'd go with property injection on the base class (to save passing them through all the time) and ctor injection for everything else. One solution for your problem could be an interface that defined the services as properties. Then you could allow property injection only for that interface, your view models that take that standard set could implement the interface to get them and any additional services would be injected the standard way. You do end up with some property injection but it's limited and you avoid the base class concerns. (Disclaimer: haven't tried this, not sure which IoC containers will let you wire up injection method based on interface rather than implementation.)
|
# ¿ Jun 1, 2015 05:42 |
|
Not sure about Mercurial but I've seen setups that the CI server will create a git tag on the commit it used to achieve the same effect. edit: for background tasks on a web app I've heard good things about http://hangfire.io Destroyenator fucked around with this message at 02:28 on Jun 2, 2015 |
# ¿ Jun 2, 2015 02:26 |
|
I didn't realise how far the Roslyn stuff has come but yeah the three types of search and go to implementations for interfaces, refactor tools (especially introduce var/param and inline), snippet stuff for all the common operations (use var, invert if to reduce nesting, remove dead code, simplify conditionals, foreach-linq conversions, remove braces). I find in a solution with DI/IoC I'm using this pattern all the time: type "_userService", alt-enter -> introduce field, the type is highlighted so type "IUS" press enter, alt-enter -> initialise from ctor param (which jumps to the ctor), jump up to issue and alt-enter -> make readonly, jump down issue which is usually my unfinished line. It looks like with the Roslyn stuff I'd be able to make that a thing I can do in one step?
|
# ¿ Jun 15, 2015 05:01 |
|
Uziel posted:We would actually be running it on the same machine (dedicated to our app) since its an intranet application. Guessing private queues would work then!
|
# ¿ Jun 27, 2015 22:52 |
|
Write tests for what's going to break and for odd cases that will be forgotten so that when people fix your code they don't break the functionality. Good tests should explain the code, but always consider [value delivered/time spent] for everything your write.
|
# ¿ Jul 3, 2015 23:21 |
|
GrumpyDoctor posted:I'm having a weird AutoMapper problem. Mapper.AssertConfigurationIsValid() succeeds, but all my actual mappings are failing with "Missing type map configuration or unsupported mapping." As an example: I'm mapping a Source.GlazingMaterial to a Destination.GlazingMaterial, but the mapper, in a child mapping, then tries to map the source object itself to an Int32 field, which obviously fails. I don't know which one, because neither type even has any Int32 fields. Something like this is happening with every type - the mapper tries to map the source object itself to a field on the destination object (which may not even exist). Calling Mapper.Reset() before establishing my mappings doesn't fix the problem. Is there any way to ask AutoMapper wtf it thinks it's doing?
|
# ¿ Jan 3, 2016 18:57 |
|
Weird. Any chance it's generating a parent class mapping that's getting selected so the child specific fields aren't recognised?
|
# ¿ Jan 4, 2016 08:18 |
|
xUnit and Shouldly, sometimes Moq or Autofixture. The NCrunch test runner is pretty amazing but it's quite pricey, I usually use it in conjunction with the ReSharper one. Most build servers will make it easy to use the xUnit standalone runner.
|
# ¿ Apr 22, 2016 12:19 |
|
Untested, but I think this would do it?C# code:
|
# ¿ Jul 22, 2016 22:36 |
|
|
# ¿ May 2, 2024 00:36 |
|
rarbatrol posted:Yeah, switching from C# to F# at work feels like going back to working with notepad sometimes. Gul Banana posted:talking the language maintainers into using a multipass compiler and allowing unordered files would be nice :-( edit: Also more guidance on coding style. We rely heavily (with R# help) on the MS style guide in C#. In F# there isn't really anything in the community or from MS about a consistent approach to naming, scoping, project layout etc. Destroyenator fucked around with this message at 13:32 on Aug 28, 2016 |
# ¿ Aug 28, 2016 13:24 |