|
epalm posted:How can I tell which resource is causing the permission problem? I always default to running Process Monitor to look at what the process is trying to access when diagnosing things like this. Might be a better way that I'm not aware of, but that should tell you. https://technet.microsoft.com/en-us/sysinternals/processmonitor.aspx
|
# ? Feb 4, 2016 21:32 |
|
|
# ? Jun 10, 2024 17:30 |
|
Quick refactoring question: Small isolated project, WPF, and only desktop use. I have one view which has a Print button to printout a simple list report so an operator can take it to a machine instead of running back-forth to the desktop. It's a "Print Preview" view that pops up and I create the FlowDocument from the Print Preview viewmodel. Very lazily done, I admit. It was supposed to be the only thing sent to a printer when I created this 8 months ago. They have now asked me to create another print out of another list on another page and also a smaller printout for a label machine from yet another page. SO I am stuck with the application having two "Print Preview" views which are practically identical code-wise and a third "Print Preview" view which will most likely be different and more complex. My mind is telling me to refactor everything to a single "Print Preview" view and ViewModel and inject my FlowDocuments from a service so I can reuse as much code as possible. More time-consuming but, might save me in the long run. My fingers are saying "screw it, copy and paste and make three views, three viewmodels and call it the day". Doubt they'll ask me to expand any more print outs but hey, we've all heard that before .Either way I choose, I'm paid the same. I'm pretty sure I know what I'll do but, I want to pick some brains and ask: What would you REALLY do? crashdome fucked around with this message at 21:54 on Feb 4, 2016 |
# ? Feb 4, 2016 21:41 |
|
epalm posted:Ah gotcha. So it's in my interest to find out why NetworkService is complaining, rather than cop out by running under a more (too) powerful account. I assume what is happening is you're getting this exception during the startup phase which kills it immediately. The other possibility, which I don't know for sure, is your network service account might not have the permission required to execute the service file. Perhaps someone changed permissions there?
|
# ? Feb 4, 2016 22:03 |
|
Squall posted:Has anyone tried to make a class library for ASP.NET Core/ASP.NET 5 and a Universal Windows application? I tried using a portable class library but usually its mere presence is enough to stop anything from building in Visual Studio. I tried and failed and added this issue to the ever growing pile titled "Reasons to stay away from ASP.NET Core".
|
# ? Feb 4, 2016 22:04 |
|
I've done it before but it involved manually running "dnu wrap" and hand-editing the output. the trick was to make a normal csproj library rather than a portable one, which UWP can just reference, and then use the wrapping project.json thing to also reference it from the asp.net core project
|
# ? Feb 4, 2016 22:31 |
|
crashdome posted:Quick refactoring question: I think this decision depends on the actual implementation time differences now and in the nebulous future. In other words: what does your heart tell you
|
# ? Feb 4, 2016 23:59 |
|
Squall posted:Has anyone tried to make a class library for ASP.NET Core/ASP.NET 5 and a Universal Windows application? I tried using a portable class library but usually its mere presence is enough to stop anything from building in Visual Studio.
|
# ? Feb 5, 2016 00:08 |
|
zerofunk posted:I always default to running Process Monitor to look at what the process is trying to access when diagnosing things like this. Might be a better way that I'm not aware of, but that should tell you. Right, Process Monitor. I need to spend some time understanding how to use it. If I capture data for a couple seconds, I have half a million records to comb though.. even if the needle I'm looking for is there, that's one hell of a haystack.
|
# ? Feb 5, 2016 00:12 |
|
epalm posted:Right, Process Monitor. I need to spend some time understanding how to use it. If I capture data for a couple seconds, I have half a million records to comb though.. even if the needle I'm looking for is there, that's one hell of a haystack. The filters are pretty powerful and straightforward.
|
# ? Feb 5, 2016 00:36 |
|
Yeah, sorry should have mentioned that you will absolutely want to use the filters. I tend to mostly just use the Process Name one myself. And make sure you click the Include button to actually add it before you click Ok.
|
# ? Feb 5, 2016 11:35 |
|
It really annoys me that Json.NET does not preserve type information for object arrays or dictionaries with object values. Even if I specify TypeNameHandling.All it just pisses on any TimeSpan objects by making them strings.
|
# ? Feb 5, 2016 13:38 |
|
Inverness posted:It really annoys me that Json.NET does not preserve type information for object arrays or dictionaries with object values. Even if I specify TypeNameHandling.All it just pisses on any TimeSpan objects by making them strings. Can't you create a custom Converter for types you want handled in a special way? You would create a class that implements Converter (or whatever its called) and then annotate your field or property with the converter you want it to use when serializing.
|
# ? Feb 5, 2016 19:47 |
|
xgalaxy posted:Can't you create a custom Converter for types you want handled in a special way? You would create a class that implements Converter (or whatever its called) and then annotate your field or property with the converter you want it to use when serializing.
|
# ? Feb 5, 2016 20:22 |
|
What is it supposed to do? Is it supposed to record the types of the value for each key when it serializes then remember that when it comes back? Is it supposed to serialize the value into some kind of wrapper object that contains the type information? How do you propose achieving this functionality?
|
# ? Feb 5, 2016 23:44 |
|
fleshweasel posted:What is it supposed to do? Is it supposed to record the types of the value for each key when it serializes then remember that when it comes back? Is it supposed to serialize the value into some kind of wrapper object that contains the type information? How do you propose achieving this functionality? This is what I did with a custom converter for IDictionary<string, object>: code:
|
# ? Feb 6, 2016 01:10 |
|
Inverness posted:The same way it preserves the type when class members are of a base type but the actual object is of a derived type: include a "$type" property with the type name. Now it only works in .Net, JavaScript won't know how to deserialize this.
|
# ? Feb 6, 2016 10:52 |
|
Mr Shiny Pants posted:Now it only works in .Net, JavaScript won't know how to deserialize this. If you're using angular or something you can define a custom deserializer on the client side too. There's no native date format in JSON (which I find insanely stupid but whatever). e: OK, I didn't look very closely at that so it would be more involved. But still, you could do it, if you wanted. RICHUNCLEPENNYBAGS fucked around with this message at 16:59 on Feb 6, 2016 |
# ? Feb 6, 2016 16:40 |
|
Mr Shiny Pants posted:Now it only works in .Net, JavaScript won't know how to deserialize this. Sure, but if you're willing to use TypeNameHandling.All, presumably you don't care about that fact.
|
# ? Feb 6, 2016 16:57 |
|
Mr Shiny Pants posted:Now it only works in .Net, JavaScript won't know how to deserialize this. For context, I'm experimenting with serializing iterators after reading an article about logic over time in games. Using async and stuff like that is great, but there is a problem where many games need to be able to serialize the state of the game after any frame. This doesn't work with async due to how continuations work with that, but iterators are much simpler in concept and execution. You can make a framework that allows you to use those iterators as coroutines with their own stacks and logical threads of execution. I made a class that takes an IEnumerator and changes it into an IteratorState object which has DataContract annotations but is neutral to any one serializer. Now I'm testing that by using Json.NET to serialize it and that means I need to be able to preserve the exact types for variables and arguments stored in Dictionary<string, object>. The result: JavaScript code:
|
# ? Feb 7, 2016 01:51 |
|
Inverness posted:Snip Can you post the article? I am curious.
|
# ? Feb 8, 2016 11:20 |
|
Is there a technical reason why there is no button in Visual Studio that builds my project and all dependencies into a single executable? I know I can use a tool like ILMerge for this, but it seems like an obvious omission.
|
# ? Feb 8, 2016 17:36 |
|
Mr Shiny Pants posted:Can you post the article? I am curious. epalm posted:Is there a technical reason why there is no button in Visual Studio that builds my project and all dependencies into a single executable?
|
# ? Feb 8, 2016 19:42 |
|
Inverness posted:Because it's not officially supported and altering other dependencies would invalidate any kind of file signing you want to do. I don't know too much about build processes under the hood. How would your dependencies be "altered"?
|
# ? Feb 8, 2016 19:48 |
|
Type names consist of assembly+typename. If you merge it all into one assembly, guess what happens - yes, all code that ever loaded any types must also change because the assembly part of the name is now different. This is why ILMerge does not work with WPF, for example - WPF hardcodes type names into XAML and that's too much for ILmerge. It's not a big deal with plain old code but Visual Studio needs to cover a lot more than just the needs of 90% of developers. There are workarounds and they work reasonably OK but it's still a hack. Maybe in the future with the .NET Native approach (compile everything, right now) taking more mindshare, this might some day become a reality. But it's really not worth the cost these days to implement it in the official toolchain, given that most people literally do not care and that any solution would not even work for a nontrivial scope of projects. Plus breaking code signing is just evil. Incidentally, LibZ is the modern alternative to ILMerge. I believe ILMerge is not really maintained and was having trouble with recent (.NET 4.6) assemblies. It also works a completely different way - instead of loving around with the actual IL code, it just embeds the other assemblies and loads them on-demand. This means it also works for WPF, among other things. EssOEss fucked around with this message at 20:28 on Feb 8, 2016 |
# ? Feb 8, 2016 20:24 |
|
Since we're on a semi-related subject, has anybody managed to make a nice, portable* packaging of F#/C# Interactive (fsi.exe / csi.exe)? I find it a priceless utility for diagnostics, quick maintenance, and banging out all sorts of random scripts, but getting it to run on a third party computer has been pretty frustrating. * in the "can be run straight from the folder [as long as you have the .NET framework installed]" sense, not in the "can be compiled for greybeard Unix" sense
|
# ? Feb 8, 2016 21:51 |
|
NihilCredo posted:Since we're on a semi-related subject, has anybody managed to make a nice, portable* packaging of F#/C# Interactive (fsi.exe / csi.exe)? I find it a priceless utility for diagnostics, quick maintenance, and banging out all sorts of random scripts, but getting it to run on a third party computer has been pretty frustrating. I guess there's an REPL and the ability to run scripts in VS2015 Update 1: https://msdn.microsoft.com/en-us/magazine/mt614271.aspx e: Er, I guess you already knew that and this isn't what you're asking. Sorry.
|
# ? Feb 8, 2016 22:05 |
|
NihilCredo posted:Since we're on a semi-related subject, has anybody managed to make a nice, portable* packaging of F#/C# Interactive (fsi.exe / csi.exe)? I find it a priceless utility for diagnostics, quick maintenance, and banging out all sorts of random scripts, but getting it to run on a third party computer has been pretty frustrating. I just use LinqPad for that sort of thing
|
# ? Feb 8, 2016 22:16 |
|
GrumpyDoctor posted:I think this decision depends on the actual implementation time differences now and in the nebulous future. I guess I failed at a light-hearted post. I was just trying to gauge other's opinions about taking short-cuts and when. You can bet money I am copy/pasting the one class into three classes and tweaking them. Refactoring would add boat-loads more work and I don't see much being added in the future to this current project to justify it. I was just curious what others might do when faced with a similar, general circumstance.
|
# ? Feb 8, 2016 22:35 |
|
I thought the new .NET Core documents stated something about being able to bundle all your dependency assemblies together into a single executable. Also, I wish LinqPad worked in OS X.
|
# ? Feb 9, 2016 06:12 |
|
xgalaxy posted:I thought the new .NET Core documents stated something about being able to bundle all your dependency assemblies together into a single executable.
|
# ? Feb 9, 2016 13:26 |
|
Inverness posted:I think you're talking about native compilation, which is a different beast. No I'm pretty sure I'm not. Part of the deal with .NET going multiplatform is they have to find an executable bootstrapping model that will work multiplatform. As opposed to the current situation with Mono where you have to type mono in front of everything in order for it to run the executable as a managed assembly. I could be wrong, but I thought I had read that part of the bootstrapping model they are thinking of using is one where all of the assemblies are somehow bundled together.
|
# ? Feb 9, 2016 19:32 |
|
xgalaxy posted:No I'm pretty sure I'm not. Part of the deal with .NET going multiplatform is they have to find an executable bootstrapping model that will work multiplatform. As opposed to the current situation with Mono where you have to type mono in front of everything in order for it to run the executable as a managed assembly. I could be wrong, but I thought I had read that part of the bootstrapping model they are thinking of using is one where all of the assemblies are somehow bundled together. I'm not sure where this idea of bundled assemblies is coming from.
|
# ? Feb 9, 2016 20:39 |
|
I have a question. Is writing C# that doesn't obey Microsoft's C# Coding Conventions actually a thing that real people do?
|
# ? Feb 11, 2016 03:45 |
|
sarehu posted:I have a question. Is writing C# that doesn't obey Microsoft's C# Coding Conventions actually a thing that real people do? I'm in the middle of refactoring a massive brownfield application that...just yes. Yes. yes.
|
# ? Feb 11, 2016 04:18 |
|
sarehu posted:I have a question. Is writing C# that doesn't obey Microsoft's C# Coding Conventions actually a thing that real people do? https://github.com/bchavez/RethinkDb.Driver#quick-examples :-(
|
# ? Feb 11, 2016 06:20 |
|
Exactly the code that prompted the question. Also there's some if ( this.Socket != null ) and if( foo == bar ) in the implementation
|
# ? Feb 11, 2016 06:48 |
|
I feel a bit dumb asking this... when I'm working is a cshtml file in vs2015, when I hit enter after a closing tag, like </div>, </td> etc, all of the html enclosed by that pair of tags is being re-indented to the wrong level. I'm not sure if its a VS thing, resharper, or the two working against each other. So I start with something like this (all css, asp.net mvc stuff etc omitted): code:
code:
|
# ? Feb 11, 2016 07:50 |
|
Your <li> elements have a <div> but no </div> - that's probably what's causing it
|
# ? Feb 11, 2016 10:28 |
|
sarehu posted:Exactly the code that prompted the question. Also there's some if ( this.Socket != null ) and if( foo == bar ) in the implementation i think it's mechanically translated from java :/
|
# ? Feb 11, 2016 11:21 |
|
|
# ? Jun 10, 2024 17:30 |
|
Is it bad practice to store user information in session variables? I just realized how many times I look up basic user information in the database and I was thinking about keeping basic things like company id, company route and company discount in session variables so I don't need to query the database all the time.
|
# ? Feb 11, 2016 16:31 |