|
Chasiubao posted:What's everyone's opinion on the var keyword? I'm in the middle of a religious discussion on code reviews. Use var like all the time basically. (Both teams are correct, and it should almost always be immediately discernible from the RHS or you should consider refactoring)
|
# ¿ Jul 9, 2014 21:34 |
|
|
# ¿ May 8, 2024 18:07 |
|
GrumpyDoctor posted:Is there a way to get more detailed information about what's causing a TypeLoadException? I know the type it can't find, but I haven't the faintest idea why it can't find the type, and I'm pulling my hair out trying to figure out what's going on. It's always a binding redirect No seriously, whenever it hasn't been some NuGet package (or rogue developer) doing something stupid with binding redirects, I've been able to fairly easily step through the normal places .NET looks for poo poo and figure it out manually, but we also don't do much mucking about with assembly loading.
|
# ¿ Sep 12, 2014 01:20 |
|
Telerik's JustDecompile is pretty good too but by god if they aren't getting annoying with some of their nagware-like stuff. Hard to grouse about a free tool, but it used to be way less annoying
|
# ¿ Jan 8, 2015 18:22 |
|
NihilCredo posted:Speaking of using{}, if a using (foo) {} block lasts until the end of the method, is it in any way different from just declaring foo as a local variable? Yes, if foo has a Dispose defined and an exception is thrown in that block/scope, the using version will invoke the Dispose method and the other will not. Conceptually speaking (and maybe in actual compiler mojo), using is syntactic sugar for: code:
|
# ¿ Jan 16, 2015 20:27 |
|
Use VsVim and write a vim macro to do it
|
# ¿ Feb 27, 2015 00:09 |
|
Brady posted:Will this work if it's not a file, but a directory instead? Unable to test right this moment but I'm gonna try this and GI_Clutch's solution when I can. Thanks guys. The docs explicitly state that you get an empty string if it's a directory.
|
# ¿ Mar 26, 2015 17:54 |
|
epalm posted:Or looking at your own code 2 years later and asking what the gently caress you were thinking 2 years? More like 2 days or 2 hours
|
# ¿ Jul 29, 2015 05:45 |
|
Boz0r posted:I just upgraded from Visual Studio 2013 to 2015, and I'm missing a feature. In a small line above each class and function definition, it mentioned how many references to the function, who created it, and a little more. I also have ReSharper installed, and I don't remember installing anything else in 2013. Anyone know what I'm talking about? it's called codelens if that helps, it was built-in to visual studio but I immediately turned it off
|
# ¿ Aug 18, 2015 19:34 |
|
Mr Shiny Pants posted:I did this one as well, the problem with it is that it doesn't teach why you do stuff only how to do stuff. And it doesn't even really do that because the actual best way to get the cert is the answer dump. Even with a fair amount of experience in the subject area, the tests still have a decent amount of random esoteric crap that you might not have ever encountered.
|
# ¿ Aug 28, 2015 16:16 |
|
ToxicSlurpee posted:Computers are basically expensive hammers. They're tools suited to specific tasks.
|
# ¿ Oct 13, 2015 16:20 |
|
Calidus posted:Anyone have experience with Visual Studio online? I want to put my visual studio 2010 installation out to pasture, but buying TF for 2 to 3 developers seems kinda stupid. I was also debating on switching over to git, this projects to immgrate looks pretty nice: https://github.com/git-tfs/git-tfs git-tfs is pretty decent but if you have a fair amount of branch history and/or have done any nontrivial branching/reparenting or otherwise futzing with the hierarcy, git-tfs will straight up fail. I wanted to do the same but just couldn't. But if it's a relatively simple repository, it works quite well.
|
# ¿ Oct 27, 2015 15:22 |
|
Windows 10 is completely fine for .NET 4.x development, we have several guys at work who have updated their machines and there's been zero issues.
|
# ¿ Nov 18, 2015 16:45 |
|
Ithaqua posted:Learn C# instead. You can do basically all the same things in either language and the standard library is the same, but there are tons more jobs in C#. Also it'll be way easier to learn since he already knows Java/C++
|
# ¿ Jan 13, 2016 16:51 |
|
Dr. Poz posted:We upgraded to VS2015 today! Happy Day! Question: Looking over the Git integration features, it seems like Visual Studio automatically stages all changes. Is this the case? Is there any way to disable this behavior? VS doesn't stage anything until you're actually committing and AFAIK there's no way to actually stage stuff either. For this and several other reasons, I've fallen back to using the git bash terminal with occasionally jumping to Sourcetree for multi-branch management and visualization needs. The integrated stuff I do use is nice though (cloning a repo, displaying the current branch, and.. that's it). Glad they're embracing git but it's still not good enough inside the IDE for me to throw aside my external tools
|
# ¿ Jan 13, 2016 21:55 |
|
Dr. Poz posted:So if I'm understanding correctly, the files are not actually staged (i.e. I hit the command line, type "git status" and my modifications aren't staged) but them being "Included" means that if I commit from withing VS that it will stage/commit all "Included" files in a one step process. Is that right? Here, a blank solution in a new repo (I added the .sln file and as the first commit before taking this screenshot, hence the lock and not the green plus): I added a text file to the solution, typed some text in it, and saved the text file and the solution (Save All), this is what shows in the git command line: And this is what it looks like in the "Changes" window: So it's in the "included" section even though it's not staged, which is confusing. You can manually add them with git add and that display doesn't change. So I just prefer to use the command line now No Safe Word fucked around with this message at 23:24 on Jan 13, 2016 |
# ¿ Jan 13, 2016 23:22 |
|
epalm posted:Zero. This all reads like something that should be submitted to Mark Russinovich for his "Case of the Unexplained" series that he presents at every TechEd: https://technet.microsoft.com/en-us/sysinternals/bb963887.aspx Honestly, you could go watch some of those and maybe get an idea of how to troubleshoot it. To nobody's surprise a lot of them hinge around running SysInternals tools
|
# ¿ Jan 26, 2016 16:29 |
|
epalm posted:I downloaded and ran Process Monitor, and then ran the ASP project. PM collected 500,000 events. I don't know what's signal and what's noise, but I'm combing through it to see if anything sticks out. I'm actually looking for a line that says "check this checkbox in Visual Studio to solve your specific problem"
|
# ¿ Jan 26, 2016 18:43 |
|
ProcMon wins again! Seriously the SysInternals stuff is kinda ugly and busy but super freaking useful. Process Explorer has been my Task Manager replacement since Ye Olde WinXP days.
|
# ¿ Jan 26, 2016 18:55 |
|
redleader posted:We mostly follow the MS guidelines, but use K&R-style braces rather than Allman. I kinda like it. Yeah we mostly follow them with this exception plus we pretty much always use interpolated strings now instead of using string concatenation basically ever since we're using C# 6.
|
# ¿ Feb 15, 2016 17:40 |
|
Malcolm XML posted:Service bus is a clusterfuck and does not scale well [[citation needed]] We've run some preliminary performance tests and it has held up okay, what about it doesn't scale well?
|
# ¿ Feb 26, 2016 20:21 |
|
Malcolm XML posted:It's based on SQL server internally and has all the issues that brings when dealing with thousands+ events a second especially the whole noisy neighbor thing that wrecks cloud sql Did you try using express queues/topics? https://azure.microsoft.com/en-us/documentation/articles/service-bus-performance-improvements/#express-queues-and-topics
|
# ¿ Feb 29, 2016 16:03 |
|
gariig posted:Generally Allman style (the one from Unity) because it is Microsoft's default within Visual Studio. Programmers Stackexchange has some info on it and why it might be. It's not difficult at all to tell Visual Studio to format things differently. But having it consistently actually follow the rules you set, on the other hand, is indeed an uphill battle. Of note, in 22 Eargesplitten's example, the default Visual Studio style actually doesn't put spaces between function names and the parens for the args. So that looks like a custom style rule being applied. You can change it in the Text Editor settings for each language under Tools > Options
|
# ¿ Mar 2, 2016 23:44 |
|
In this thread?code:
|
# ¿ Mar 5, 2016 13:05 |
|
Bognar posted:For your enjoyment, I downloaded and grepped the entire reference source for "----": Clbuttic
|
# ¿ Mar 30, 2016 16:24 |
|
bing_commander posted:I'm looking for a C# book. Is the recommendation in the op still up to date? I like Lippert's Essential C# personally
|
# ¿ May 4, 2016 16:52 |
|
epalm posted:Something I didn't mention is there's a ton of generics and inheritance, so a change to a method in a super class which deals with "T" will basically make me have to change everything at once, instead of bit by bit. code:
code:
code:
|
# ¿ Jul 6, 2016 23:00 |
|
Ithaqua posted:You can have an async method with no awaits. The compiler will warn you that it will run synchronously, but that's okay. Oh I always build with warnings as errors so that would be why I thought the compiler enforced it
|
# ¿ Jul 6, 2016 23:25 |
|
ljw1004 posted:cool stuff including the Channel 9 series I watched all of Thanks for this, it's already driving some changes in our library code at my work. One question though: what do you do in the cases where you are implementing an interface or an abstract method that is async by design because in the cases where the implementers can use async/await, doing so is very useful, but there are cases where some cannot reasonably do any truly asynchronous stuff? Obviously shoe-horning things into a Task is a big time red flag as you referenced in your 4th tip. So, for example, we have a custom logging library that has a bunch of different targets (console, file system, Azure blob storage, etc.), so we have an asynchronous interface: C# code:
For the Azure and file system loggers, there are natural Async methods we can await, but for the console one there's not: C# code:
|
# ¿ Jul 22, 2016 21:55 |
|
Destroyenator posted:Untested, but I think this would do it? Well yeah the other (and probably better?) version would be: C# code:
|
# ¿ Jul 22, 2016 22:39 |
|
PSA: ILSpy is just way better than Telerik's JustDecompile and it isn't nagware
|
# ¿ Nov 9, 2016 00:08 |
|
The Wizard of Poz posted:Real quick informal poll: - 10GB of virtual RAM (the laptop has 16GB) - allowed to use all 4 cores, with an execution cap of 100% - running Windows 10, VS 2015 - network was actually plumbed through 3 different interfaces: 1 pure NAT, 1 bridged directly to the wired ethernet, 1 bridged directly to wireless (I mostly kept the latter two disabled but if I needed to I would disable/enable from within Windows and it worked like a charm) - 150GB VDI disk This is on a relatively recent laptop (~2 years old now): - i7 5600U 2.6GHz, quad core - 500 GB SSD The base OS is running Debian Jessie. The performance was pretty good. Not amazing, but pretty good. I was able to drive all three screens via three separate VBox screens which was nice. It flipped out when I docked/undocked fairly regularly though. Rebooting the VM fixed it though.
|
# ¿ Jan 23, 2017 23:16 |
|
code:
The result is null
|
# ¿ Aug 10, 2017 19:39 |
|
B-Nasty posted:I'd still recommend AzureSB in cases where using cloud stuff is allowed. The basic level should cost you less than a few dollars a month, and the 'standard' level is about $10/month (assuming always on) and includes topics and other advanced functionality. Self-hosting Rabbit with redundancy may end up costing more in time+hardware costs. Of all the Azure infrastructure pieces I use at work, Service Bus is probably the best of them (Cosmos DB is pretty good too, in spite of its stupid name). Would definitely concur with this. The one thing that is moderately lacking is official tooling for it, though you can do simple stuff in the Azure Portal, and the third party Azure SB Explorer is good enough to do all we need.
|
# ¿ May 16, 2019 22:45 |
|
No Pants posted:This blog post came out last month, and it's good reading if you have any interest in what ConfigureAwait does. That's a pretty good article, shared with my team here. .NET Megathread 3.5: await GetGoodPosts().ConfigureAwait(false)
|
# ¿ Jan 7, 2020 16:43 |
|
|
# ¿ May 8, 2024 18:07 |
|
Yeah the (weak) joke was "I don't care what thread good posts end up in just get them there ASAP"
|
# ¿ Jan 7, 2020 17:41 |