|
Funking Giblet posted:Why not write the commit id of the build to the assembly as the Product Number or something, instead of committing from Jenkins. Thanks, that or similar is what I am thinking of doing.
|
# ? Jun 1, 2015 23:10 |
|
|
# ? Apr 28, 2024 09:32 |
|
Uziel posted:Bah, intellisense has entirely broken for Visual Studio 2013. Has this happened to anyone before? I've tried closing visual studio, restarting, deleting the suo file, etc. Any ideas? As an aside, these options tend to get turned off on a Reshaper uninstall or trial expiry.
|
# ? Jun 2, 2015 02:24 |
|
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 |
So I noticed that System.Diagnostics.Process.Start returns a process object. I also noticed that object implements IDisposable. Does this mean that I always have to dispose the result of Process.Start? Do I need to write some kind of method like this? code:
code:
|
|
# ? Jun 2, 2015 15:26 |
|
wilderthanmild posted:So I noticed that System.Diagnostics.Process.Start returns a process object. I also noticed that object implements IDisposable. Does this mean that I always have to dispose the result of Process.Start? I don't think you have to dispose it, but the general idea for anything that implements IDisposable is to wrap it in a using block so it's automatically disposed when it goes out of scope. http://stackoverflow.com/questions/5857893/use-of-process-with-using-block
|
# ? Jun 2, 2015 16:42 |
|
The process object is wrapping a handle so you could argue that it's beneficial to dispose, but that's fairly lightweight and it gets disposed on garbage collection. I've never disposed processes, but when in doubt you're probably better to err on the side of disposing.
|
# ? Jun 2, 2015 21:37 |
Thanks for answering my question.Ithaqua posted:I don't think you have to dispose it, but the general idea for anything that implements IDisposable is to wrap it in a using block so it's automatically disposed when it goes out of scope. I generally do, but I was checking that everything was being disposed properly in my program and noticed that process implements IDisposable. I was a little surprised and worried because I use Process.Start frequently to start applications and open files. I don't tend to do anything with it afterward, so the using statement with a {} afterward looked a little strange to me. Bognar posted:The process object is wrapping a handle so you could argue that it's beneficial to dispose, but that's fairly lightweight and it gets disposed on garbage collection. I've never disposed processes, but when in doubt you're probably better to err on the side of disposing. That's kind of what I was figuring. As long as it doesn't hurt to dispose, better safe than sorry.
|
|
# ? Jun 3, 2015 13:43 |
|
wilderthanmild posted:That's kind of what I was figuring. As long as it doesn't hurt to dispose, better safe than sorry. I'm pretty sure it doesn't hurt. Disposing it doesn't abort the process. All it does is surrender your ability to monitor/control the process. I always dispose mine.
|
# ? Jun 3, 2015 13:50 |
|
Got a loving weird problem. As soon as I try and instantiate an SqlConnection, my application immediately exits, with nothing caught in my catch block. I'm literally just doing this in a simple C# console application:code:
Any idea, anyone? e: Saw someone on Stack Overflow with this problem, a using block fixed it for them (it doesn't for me). I also saw some people suggesting that his .NET installation was broken, but I have other projects that this is working fine in. chippy fucked around with this message at 17:42 on Jun 3, 2015 |
# ? Jun 3, 2015 17:39 |
|
Have you double-checked that your debugger is set up to break on all thrown exceptions?
|
# ? Jun 3, 2015 17:45 |
|
Also check the Event Viewer. The .NET framework will put in an entry, it's usually not very helpful but it's a start EDIT: Can you also post a little more code? At least what your catch block looks like. Also, make sure your catch block does something with the caught Exception (even Console.WriteLine). Sometimes I'll have a breakpoint on "useless" code and the JITer realizes this and skips it. gariig fucked around with this message at 18:01 on Jun 3, 2015 |
# ? Jun 3, 2015 17:56 |
|
This assert didn't trip (DEBUG is set):C# code:
Immediate Window posted:coreMultiplier
|
# ? Jun 3, 2015 19:57 |
|
GrumpyDoctor posted:Have you double-checked that your debugger is set up to break on all thrown exceptions? And juuust in case, are you in Debug mode (not Release mode)?
|
# ? Jun 3, 2015 20:42 |
|
No, not in release. The method that uses the connection is actually the callback for a Timer. I found that if I just call the method without using the timer it doesn't have this problem. Anyone know why that would stop it working? It should be pretty simple. It's just a service that needs to run a stored procedure every few seconds. Maybe my approach is all wrong, I'm not at work now bit I'll post some code tomorrow.
|
# ? Jun 3, 2015 22:18 |
|
chippy posted:No, not in release. The method that uses the connection is actually the callback for a Timer. I found that if I just call the method without using the timer it doesn't have this problem. Anyone know why that would stop it working? EDIT: I'm sorry, I mixed GrumpDoctor's "no exception happening" with your "doesn't even get into the catch clause which surrounds it". Yours sounds really weird. Maybe it's one of the .net uncatchable exceptions? https://msdn.microsoft.com/en-us/library/system.timers.timer.elapsed%28v=vs.110%29.aspx quote:The Timer component catches and suppresses all exceptions thrown by event handlers for the Elapsed event. This behavior is subject to change in future releases of the .NET Framework. (Well, the MSDN docs say it is subject to change, but I bet it never will change since that'd be a terrible breaking change.) ljw1004 fucked around with this message at 01:02 on Jun 4, 2015 |
# ? Jun 3, 2015 22:40 |
|
I hope Satya is paying you the big bucks
|
# ? Jun 3, 2015 22:52 |
|
ljw1004 posted:https://msdn.microsoft.com/en-us/library/system.timers.timer.elapsed%28v=vs.110%29.aspx Hmm ok, well that solves one mystery, but the question is, why is just instantiating the SqlClient with its default constructor throwing an exception, and why is it not throwing the exception when the same method is run without using the timer?
|
# ? Jun 3, 2015 23:30 |
|
Oh, in fact, that's the wrong Timer class anyway. I'm using System.Threading.Timer
|
# ? Jun 3, 2015 23:33 |
|
chippy posted:Oh, in fact, that's the wrong Timer class anyway. I'm using System.Threading.Timer Try wrapping the call in a try catch and see what exception is popping out... exceptions in System.Threading.Timer will crash the program
|
# ? Jun 4, 2015 01:27 |
|
TheBlackVegetable posted:Try wrapping the call in a try catch and see what exception is popping out... exceptions in System.Threading.Timer will crash the program It's in a try catch and it's not catching anything at all, that's the confusing thing. It's just jumping out of the method. I've come up with a theory as to why in my sleep now though...
|
# ? Jun 4, 2015 08:47 |
|
Nope, that wasn't right. OK, someone help! This is the console app version. It's mean to be a service eventually. All it needs to do is open the connection and do some work every 6 seconds. Program.CS: code:
code:
|
# ? Jun 4, 2015 08:54 |
|
chippy posted:Nope, that wasn't right. OK, someone help! You'll need to block before exiting the application - I like to use the CancelKeyPress coupled with a WaitOne - hit Ctrl-C to close the application. This should let you see the sql call execute and any hit any exceptions.
|
# ? Jun 4, 2015 10:34 |
|
TheBlackVegetable posted:You'll need to block before exiting the application - I like to use the CancelKeyPress coupled with a WaitOne - hit Ctrl-C to close the application. This should let you see the sql call execute and any hit any exceptions. This is probably it, chippy - your program is exiting because you're hitting the end of Main. My guess is that SqlConnection's constructor is the first operation expensive enough to cause a context switch that lets Main complete.
|
# ? Jun 4, 2015 11:26 |
|
Yeah, you guys are right I think. Once I worked out how to attach the debugger, it turned out that the service version was actually crashing for a different reason. Got that all fixed up and it's working all nice. Thanks all.
|
# ? Jun 4, 2015 12:22 |
|
Ok, I think I'm going crazy. I wrote a small scheduling program for myself and other teachers in my branch (I work at a small academy). One of the things you can do in the program is define a list of custom holidays that get factored in to the automatic syllabus/homework generation process. A winform displays a calendar, you click some dates, the dates turn bold and get added to the list of the syllabus generator. Wrote it a few months ago. Worked fine. Distributed the software. New quarter started on Monday. Since then, people have been calling me telling me that my program now crashes out when trying to select custom holidays. It never did that before, and I haven't issued any new versions yet. I loaded the release version the other teachers have. It crashes. I tested my current in-progress revision. It crashes. None of the code in the calendar form has changed. It's one isolated part, here: code:
code:
I'm doing what it says and literally nothing's changed. It worked the last time, and I've changed nothing. Hand to God. What is happening
|
# ? Jun 4, 2015 14:33 |
|
This SO post is probably relevant: http://stackoverflow.com/questions/30262731/strange-error-in-monthcalendar-just-started-happening-out-of-nowherequote:After I installed the Windows updates from Tuesday and rebooted my PC, I could replicate the problem easily. It turns out this (6 year old!) code now crashes .NET even though it's been working for years. quote:I was filling the BoldedDates property with an array of Dates. That was causing the control to automatically call the UpdateBoldedDates() function and there was the crash. All I did was that I replaced the code by adding bolded date one by one (there is no performance loss). When doing this, the UpdateBoldedDates() function must be called manually
|
# ? Jun 4, 2015 14:39 |
|
That's really dumb! Thank you, though.
|
# ? Jun 4, 2015 14:49 |
|
If I have an iterator method like this (simplified example):code:
I can fix this by doing something like: code:
|
# ? Jun 4, 2015 15:28 |
|
I don't think there's a better way. That's how the extensions on IEnumerable are written. http://referencesource.microsoft.com/#System.Core/System/Linq/Enumerable.cs,9463aefcdc7c766f,references
|
# ? Jun 4, 2015 15:50 |
|
You can sometimes write your extension method in terms of existing methodsC# code:
|
# ? Jun 4, 2015 16:10 |
|
So if you want to create a WebSharper website, what are your options for good-looking UI controls beside KendoUI?
|
# ? Jun 4, 2015 19:55 |
|
What's the best online resource for learning WPF for someone with prior WinForms experience? (I think I might have asked this before)
|
# ? Jun 5, 2015 13:09 |
|
I recommend starting by looking at MVVM Light and viewing one of their projects. Then get a book. WPF by itself is not entirely too different from WinForms IMO. It's just mostly in XAML instead of a Designer.cs file. As a result, you can fall into the trap of developing using old habits (e.g. tons of Event Handlers, UI references in BL, etc..). You should instead focus on a practice like MVVM because otherwise you'll just make a ton of code-behind to make WPF feel like WinForms which is a bad idea and leads to frustration. I had to cast everything I knew aside about WinForms and practice MVVM a few times to fully understand the capabilities of WPF. I also bought a book about Prism even though I don't use it. The concepts are the same and it's really in-depth. Sorry if I don't mention a specific book. Most of my knowledge came from Prism 5 for WPF and augmented with blog reading. edit: Prism 5 for Wpf is free btw crashdome fucked around with this message at 13:52 on Jun 5, 2015 |
# ? Jun 5, 2015 13:41 |
|
chippy posted:What's the best online resource for learning WPF for someone with prior WinForms experience? Check out Josh Smith's blog.
|
# ? Jun 5, 2015 14:06 |
|
crashdome posted:WPF by itself is not entirely too different from WinForms IMO. The basic idea and controls are similar, but the practices are totally different and largely opaque. I like WPF, but I hate that it doesn't help you fall into the pit of success. There's nothing in it that gently guides you into using MVVM and data binding instead of just cramming the entire application in MainWindow.xaml.cs.
|
# ? Jun 5, 2015 14:14 |
|
Yeah, I guess really it's the MVVM pattern I need/want to learn more than anything. Thanks for the recommendations. re: The recommendations for MVVM light and Prism, would it not be better to just learn the 'pure' WPF framework on its own first? To know how the plumbing works, so to speak. Is MVVM not a fundamental part of WPF anyway? chippy fucked around with this message at 15:49 on Jun 5, 2015 |
# ? Jun 5, 2015 15:46 |
|
crashdome posted:I recommend starting by looking at MVVM Light and viewing one of their projects. Then get a book. I found XAML to be really incomprehensible until I read a book on it. The MSDN documentation was just to piecemeal and lacked the bigger picture. The book I read was "Windows 8.1 Apps with XAML and C# Unleashed" by Adam Nathan. Brilliant book. It looks like he has several others in the series -- "XAML unleashed (Dec 2014)", "WPF 4.5 unleashed (Aug 2013)", "Universal Windows Apps Unleashed (Feb 2015)", "Win10 Apps with XAML and C# unleashed (2nd edition, Dec 2015)". I guess he's milking the cash cow I don't know which in the series is best for you. The big revelation to me was that XAML is merely a general-purpose declarative language for instantiating objects, with XAML language features for wiring them up. Now the kind of objects that people typically instantiate are UI objects from a particular UI framework, either WPF or WinRT. But the XAML language itself is neutral about this. Adam's book covered both XAML as a language, and (in the book I read) key conceptual things about the WinRT UI framework. Summary: I think you need to learn XAML as well as MVVM!
|
# ? Jun 5, 2015 17:43 |
|
chippy posted:Yeah, I guess really it's the MVVM pattern I need/want to learn more than anything. Thanks for the recommendations. I find frameworks unnecessary. Grab Josh Smith's RelayCommand and build yourself a base class for your viewModels. You can also learn about implementing IDataErrorInfo from his examples which works hand in hand with wpf/mvvm and provides all input validation needs. See my post here for additional ideas to make things easier for yourself: http://forums.somethingawful.com/sh...0#post442712636 If you have any specific questions I can elaborate on the above.
|
# ? Jun 5, 2015 19:28 |
|
I might be dragging you in circles with my opinion but, I came from a strictly WinForms background with a little Web Services and ASP.NET sprinkled in. I am looking at my first test project of WPF and it was basically me recreating a WinForms project but, shoehorning it in WPF while trying to comprehend XAML. Once I picked up something on MVVM I realized I barely need XAML other than to fine tune the UI. If you want to start with XAML and plumbing first, by all means dive away. You will, however, have to understand you really don't need code-behind for most things and the designer still lets you click through and set properties like you are used to. Likewise, XAML will have more advanced topics you'll need for just straight MVVM structure using RelayCommands and some Model binding. I spent most of my time in WinForms writing Databinding and Event Handlers. Most of that goes away if you set up your business logic properly. At least that is my take on it. Ithaqua posted:The basic idea and controls are similar, but the practices are totally different and largely opaque. I like WPF, but I hate that it doesn't help you fall into the pit of success. There's nothing in it that gently guides you into using MVVM and data binding instead of just cramming the entire application in MainWindow.xaml.cs. I guess I meant "the basic controls and ideas" and, as you say, it really doesn't stop you from mimicking WinForm behavior in your design. I would even say it almost entices you to do so if that is what you are most familiar with. crashdome fucked around with this message at 00:58 on Jun 6, 2015 |
# ? Jun 6, 2015 00:56 |
|
|
# ? Apr 28, 2024 09:32 |
|
NihilCredo posted:So if you want to create a WebSharper website, what are your options for good-looking UI controls beside KendoUI? If you ever find out please share it, I'd be interested in what other options are available.
|
# ? Jun 7, 2015 21:56 |