|
EmmyOk posted:I realised that I'd created a .NET Core project instead of .NET Framework Windows Compatibility Pack will make this also work on .NET Core some day, in case you need it.
|
# ? Feb 6, 2018 06:24 |
|
|
# ? Jun 1, 2024 17:50 |
|
roflsaurus posted:snip Have you tried running multiple instances of the existing software? Maybe run that in Azure?
|
# ? Feb 6, 2018 08:12 |
|
Ugh, this is driving me insane. Razor integration in VS has always been flaky. VS2017 professional, Core MVC 2.0. Intellisense isn't working well in Razor files - namely, I'm not getting function/constructor parameters. Syntax highlighting works well and I'm getting intellisense for types themselves, but not for function parameters.
|
# ? Feb 7, 2018 17:00 |
|
What do y'all like to call variables which point to Tasks? I mean for stuff like this: code:
|
# ? Feb 8, 2018 17:49 |
|
chippy posted:What do y'all like to call variables which point to Tasks? I think "task" is fine. You could also call it "runningClientConnection" or "incompleteConnection" or "attemptingClientConnection" or something that indicates that it's an in-progress activity.
|
# ? Feb 8, 2018 18:25 |
|
chippy posted:What do y'all like to call variables which point to Tasks? "Hungarian notation" is specifically about 1. Short prefixes to indicate the type/role of a variable, and 2. The pervasive use of these on all or almost all variables in the codebase. I find it silly to dismiss all variable names that allude to the variable type in their names just because people went overboard with it in the past. Just call it "fooTask". On the subject of Hungarian notation and Tasks, something I do find unnecessary in most cases is the overused "Async" suffix. I get the point for library code where you often have a sync/async method pair and you want to make it clear which is which, but in app code I really don't see the point. Imagine if every method that returns an IEnumerable was supposed to be called something like GetThingsLazy() instead of just GetThings(), or if every method whose return value might be null was supposed to be GetThingNullable(). GetThingsAsync() is the same thing IMO.
|
# ? Feb 8, 2018 20:41 |
|
Is SQLDependency the right way to do server change notifications? I've got a tiny wpf app that a few people use. Originally I jammed in a timer with a check of the lastupdated datetime column every few minutes but it feels dirty. Stuff like SignalR gets all the google search love but it seemed like more of a web thing. Using SQLDependency with entity framework returns so little in google that I really felt like I was barking up the wrong tree.
|
# ? Feb 8, 2018 21:11 |
|
Unlikely. I would flip the question around entirely: what makes you think you need change notifications? What is the actual goal of your app?
|
# ? Feb 8, 2018 22:12 |
|
A few people sit and work on 'orders' all day, randomly. These are shown in detail and in a grid. I don't want the user to have to do something to ensure a record they are looking at is up to date(like someone else changing a time). If it's visible on the screen, it should be relatively up to date even if the pc is completely idle.
|
# ? Feb 8, 2018 22:21 |
|
Found this code in my work's codebase, figured I would share.code:
Yes, it filters down a collection to a single value, then does a foreach loop on the filtered collection, then sets a single property value on a single object to the filtered value. If only there was some sort of assignment operator to easily set a string property to an arbitrary string!
|
# ? Feb 8, 2018 23:35 |
|
Protocol7 posted:Yes, it filters down a collection to a single value, then does a foreach loop on the filtered collection, then sets a single property value on a single object to the filtered value. If there aren't any side effects you could rewrite it as code:
|
# ? Feb 9, 2018 03:24 |
|
Good news everyone! We might be able to dodge the JS bullet after all! https://blogs.msdn.microsoft.com/webdev/2018/02/06/blazor-experimental-project/
|
# ? Feb 12, 2018 12:49 |
|
amotea posted:Good news everyone! We might be able to dodge the JS bullet after all! I certainly like the idea of importing a thing that'll make my existing cshtml behave like a SPA. Dealing with the inevitable bugs might even be easier than a re-write
|
# ? Feb 12, 2018 15:32 |
|
amotea posted:Good news everyone! We might be able to dodge the JS bullet after all! Holy moly. I've been trying to convince myself to finally learn one of those JS frameworks. Maybe I don't need to??
|
# ? Feb 12, 2018 16:25 |
|
I dunno, this seems like the kind of thing that's going to need to bake for a few years before it's ready to be used in any professional capacity. Angular is a great framework for web app development that fits with SOLID OOD type developer's habits. If that describes you I'd take the time to learn it.
|
# ? Feb 12, 2018 16:39 |
|
Is there anything that updating to the latest version of Windows 10 would make this code now return a different value from what it was returning a couple of weeks ago (or on an entirely different computer running Windows 7, they used to match)code:
|
# ? Feb 12, 2018 17:56 |
|
Dietrich posted:I dunno, this seems like the kind of thing that's going to need to bake for a few years before it's ready to be used in any professional capacity. This. However, https://bridge.net/ has been around for a few years, and is a much better choice if you want to run C# in the browser in production in 2018.
|
# ? Feb 12, 2018 19:28 |
|
Crossposting from the C++ thread, in case some windows people here have some advice:epalm posted:Anyone have experience dealing with an overactive Windows Defender? It's labeling one of our programs as "Trojan:Win32/Azden.B!cl" and immediately quarantines the file.
|
# ? Feb 12, 2018 20:02 |
|
Just-In-Timeberlake posted:Is there anything that updating to the latest version of Windows 10 would make this code now return a different value from what it was returning a couple of weeks ago (or on an entirely different computer running Windows 7, they used to match) I see one thing here that might be different between the machines - whatever is in "data"! If this does not lead to an obvious solution, post the full code with inputs that reproduces the issue.
|
# ? Feb 12, 2018 20:22 |
|
EssOEss posted:I see one thing here that might be different between the machines - whatever is in "data"! Fair enough, I just wrote this to test it on each system code:
This is used to create some salts so it actually calls another function to garble up some of the input ("data" variable in my previous post), so to mimic part of it I added the .Reverse() part up above and this is where the output differs between Windows versions Windows 7, VS 2015, .NET 4.5.2 code:
code:
edit: If I just run this code: code:
Windows 7: code:
code:
Just-In-Timeberlake fucked around with this message at 21:34 on Feb 12, 2018 |
# ? Feb 12, 2018 21:10 |
|
Oh! If you print out your "data" variable after .Reverse().ToString(), you will find the reason for your conundrum:code:
code:
|
# ? Feb 12, 2018 21:41 |
|
EssOEss posted:Oh! If you print out your "data" variable after .Reverse().ToString(), you will find the reason for your conundrum: Ok, I can work around that, thanks for pointing me in the right direction. Any idea why one is different than the other between Windows versions?
|
# ? Feb 12, 2018 22:10 |
|
How sure are you that data is the same between the two systems? Could there be some invisible characters (e.g. non-breaking spaces) in one of them? You could try comparing a hex dump of the two strings. Find a third machine and see what that one does.
|
# ? Feb 12, 2018 22:29 |
|
redleader posted:How sure are you that data is the same between the two systems? Could there be some invisible characters (e.g. non-breaking spaces) in one of them? You could try comparing a hex dump of the two strings. I literally copied and pasted from one VM to the other, can't see how something extraneous got in there. Anyway, the problem is solved, I'm just curious why the <ReverseIterator> type returned is different between Windows versions.
|
# ? Feb 12, 2018 22:37 |
|
Most likely ever-so-slightly different versions of the .NET framework. Hell, the exact class is an implementation detail, so as long as it implements the interface it could return a different class with every call for all your code cares (or should care). Edit: Since System.Linq.Enumerable+<ReverseIterator>d__74`1[System.Char] and System.Linq.Enumerable+<ReverseIterator>d__75`1[System.Char] appear to be the names of classes generated by the compiler for iterator blocks, it could be as simple as a method in System.Linq.Enumerable being added, removed, or moved around in the source code. NiceAaron fucked around with this message at 06:19 on Feb 13, 2018 |
# ? Feb 13, 2018 06:13 |
|
Haha just remembered VS had those capitalized menu items in some release a while ago.
|
# ? Feb 13, 2018 13:02 |
|
amotea posted:Haha just remembered VS had those capitalized menu items in some release a while ago. I just happened to need to open Visual Studio 2013 for some testing today and was also reminded of WHAT A GOOD IDEA IT IS TO HAVE EVERYTHING IN CAPS.
|
# ? Feb 13, 2018 19:25 |
|
I've got a SUPER tiny mvc site running locally. Every morning, the first query(entity framework) takes a good 30 seconds to 1 minute, then everything is instant after that. IIS and SQL are on the same server, and the server isn't restarting overnight. Any ideas?
|
# ? Feb 13, 2018 22:12 |
|
bobua posted:I've got a SUPER tiny mvc site running locally. Every morning, the first query(entity framework) takes a good 30 seconds to 1 minute, then everything is instant after that. IIS and SQL are on the same server, and the server isn't restarting overnight. Any ideas? IIS is recycling the app pool. You have to keep it loaded in memory by hitting the site constantly with a script or configure IIS to only recycle if it leaks too much memory.
|
# ? Feb 13, 2018 22:17 |
|
Munkeymon posted:IIS is recycling the app pool. You have to keep it loaded in memory by hitting the site constantly with a script or configure IIS to only recycle if it leaks too much memory. In addition to this, you might want to look at the application initialization module for IIS, which will restart your site after a recycle
|
# ? Feb 13, 2018 22:22 |
|
If I'm getting exceptions that look like they come from an async method when I hit a synchronous API endpoint, does that mean something is failing before the actual API method is run? Endpoint looks likeC# code:
code:
|
# ? Feb 14, 2018 00:20 |
|
Munkeymon posted:If I'm getting exceptions that look like they come from an async method when I hit a synchronous API endpoint, does that mean something is failing before the actual API method is run? Endpoint looks like Is the 'MumAuthorizationRequest request' object null? The reference to request.id would throw an error if request is null.
|
# ? Feb 14, 2018 00:43 |
|
Munkeymon posted:If I'm getting exceptions that look like they come from an async method when I hit a synchronous API endpoint, does that mean something is failing before the actual API method is run? No. It just means your synchronous API was called from some asynchronous code which is perfectly normal. The poster above has the reason for the error.
|
# ? Feb 14, 2018 07:09 |
|
downout posted:Is the 'MumAuthorizationRequest request' object null? The reference to request.id would throw an error if request is null. That would make perfect sense except that IDK how it could be on one server and not the other, given the same request. IIS settings shouldn't matter by then because the request got all the way into the controller code, so I guess I need to diff my local bin and the deployment directory.
|
# ? Feb 14, 2018 14:36 |
|
Munkeymon posted:That would make perfect sense except that IDK how it could be on one server and not the other, given the same request. IIS settings shouldn't matter by then because the request got all the way into the controller code, so I guess I need to diff my local bin and the deployment directory. A null check could be done in code before the line. At least that would confirm if it is null, before doing further investigating.
|
# ? Feb 14, 2018 16:25 |
|
downout posted:A null check could be done in code before the line. At least that would confirm if it is null, before doing further investigating. Yep, I'm sure now that the test server sees a null request object, but I still don't see why. The old test server works as expected and it works when I build locally in test configuration (and gives me the same async-style errors). I know it wasn't a one-off bad deploy because it built and deployed overnight and it still sees a null object. One wrinkle is that I can't try the new test configuration because I can't get to that database right now because I'm working from home today and permissions are fucky on the new environment I guess, so I'll probably be back tomorrow Munkeymon fucked around with this message at 19:27 on Feb 14, 2018 |
# ? Feb 14, 2018 19:25 |
|
I just wanted to say that C# 7 is pretty cool. The problem is that now I am returning ValueTuples after using F# for awhile......
|
# ? Feb 14, 2018 20:59 |
|
Mr Shiny Pants posted:I just wanted to say that C# 7 is pretty cool. The problem is that now I am returning ValueTuples after using F# for awhile...... Why is it a problem?
|
# ? Feb 14, 2018 23:01 |
|
Mr Shiny Pants posted:I just wanted to say that C# 7 is pretty cool. The problem is that now I am returning ValueTuples after using F# for awhile...... IMO returning tuples is far better than piling on out parameters, though I would probably suggest if you are returning anything wider than a triple you should probably consider creating a struct.
|
# ? Feb 14, 2018 23:01 |
|
|
# ? Jun 1, 2024 17:50 |
|
I'm sad that you need .NET 4.7 to use the new tuple stuff freely. I know there's a Nuget package for ValueTuple, but for ReasonsTM I can't use that, and our servers are still on .NET 4.6.x.
|
# ? Feb 15, 2018 02:34 |