Browsing 7239 questions and answers with Jon Skeet
Just add AssemblyInfo.cs back, with only the parts that aren't autogenerated. There's nothing to stop you from applying assembly attributes in code - it's just that most of the common attributes are provided from the project settings. more 10/21/2017 8:14:23 PM
It sounds like all you need is explicit interface implementation: public class Class1 : Interface1, Interface2 { // Note the lack of access modifier here. That's important! Data Interface1.GetData() { // Implementation... more 10/20/2017 6:29:56 AM
Because it wouldn't be safe. Consider: public class GoodItem : Item<GoodItem> { // No problem } public class EvilItem : Item<GoodItem> { // GetReference body would be equivalent to // GoodItem item = this; //... more 10/19/2017 4:59:16 PM
If the set of holidays is finite (and reasonably small) It's really easy to create an infinite sequence of dates: static IEnumerable<DateTime> GetDates(DateTime start) { DateTime current = start; while (true) { ... more 10/19/2017 3:13:14 PM
The problem is your use of new BigDecimal(100.05). The value of a is then 100.0499999999999971578290569595992565155029296875. If you had specified that value as a string instead, all would be well: BigDecimal a = new... more 10/19/2017 10:45:29 AM
I'd suggest passing an argument into the Main method which is a file containing all the URLs to fetch. You can then read all those URLs into a list or array (e.g. with File.ReadAllLines, and infer the output file from the URL. Move most of... more 10/18/2017 6:16:40 PM
It sounds like your application needs its own calendar - so create one (see Calendars.insert for how to do this programmatically). Whether you need a single calendar for the whole application, regardless of user (in which case you'd... more 10/16/2017 4:45:38 PM
For almost all reflection in .NET Core 1.x, you need a TypeInfo instead of Type. There's an extension method of GetTypeInfo in the System.Reflection namespace, so you want: using System.Reflection; // For GetTypeInfo ... var methodInfo =... more 10/16/2017 11:36:51 AM
You can access the type parameter names by reflection using Type.GetGenericArguments: using System; public class Foo<TFirst, TSecond> {} class Test { static void Main() { var type = typeof(Foo<,>); ... more 10/14/2017 2:18:28 PM
Should the last logline be logged or not when a cancel is requested? No, because the task returned by Task.Delay will be faulted, as is normal when a task is cancelled. more 10/11/2017 7:14:16 AM