ekolis

1

votes
1

answer
1.8k

views

My ASP.NET Core app says it can't read web.config

I get this error when I access my app which I published to local IIS: HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid. My web.config is really simple: What could be wrong? I tried giving all users permissi...
ekolis
1

votes
3

answer
725

views

ASP.NET Razor Pages redirect isn't working

I have this OnPost method on my NewGame page: public IActionResult OnPost() { Name = Request.Form['Name']; return RedirectToRoute($'Game/{Name}'); } And on the Game page I'm redirecting to: @page '{name}' However when I submit the NewGame page with a value in the Name field, I get this error: Invali...
ekolis
1

votes
1

answer
36

views

WPF routed event firing but not being handled by handler

I have the following routed event: public static readonly RoutedEvent ItemMouseDownEvent = EventManager.RegisterRoutedEvent( 'ItemMouseDown', RoutingStrategy.Bubble, typeof(ItemMouseDownEventHandler), typeof(BindableGrid)); public delegate void ItemMouseDownEventHandler(object sender, ItemMouseDownE...
ekolis
1

votes
1

answer
27

views

Is there any way to disable the “auto stage unstaged changes on commit if nothing is staged” feature in Git in Visual Studio 2017?

I have some changes I definitely don't want to commit (production connection strings), and I'm afraid I'll accidentally commit them. In Mercurial I'd simply ignore them, but in git for VS2017 the only way to do this it seems is to make another change and stage that change; if I leave all changes uns...
ekolis
1

votes
1

answer
170

views

How do I keep the XAML editor in Visual Studio (2015) from inserting useless extra quotes after attribute values?

If I type some attribute: Width='40' then as soon as I enter the first quote, VS helpfully adds the second. However if I then want to add another attribute, what do I naturally do? Type the second quote! But then I get: Width='40'' This is in contrast with the C# editor's handling of parentheses; th...
ekolis
1

votes
1

answer
51

views

Is there a term in Mercurial for a pull followed by an update?

In git this would be just a pull, but in Mercurial pull and update are separate operations. I hate having to say 'do a pull and update' when telling someone how to grab the latest code, because it's so wordy. Is there a word for 'pull and update' I can substitute this with? (different from alleged '...
ekolis
3

votes
1

answer
136

views

IronPython.Runtime.UnboundNameException: name 'str' is not defined

I'm trying to run an IronPython script in C# but sometimes when I run it I get this error: IronPython.Runtime.UnboundNameException: name 'str' is not defined I can't figure out why this is happening; it only happens sometimes; right now it happens when I click a planet in my game to view the report...
ekolis
1

votes
2

answer
1k

views

StringBuilder to FileStream vs. direct FileStream performance [closed]

I'm writing large amounts of text data to a FileStream incrementally, and it's rather slow. Would it be faster if I were to instead write the text to a StringBuilder in memory, and then dump the StringBuilder wholesale to the FileStream? I'm thinking that doing so might be able to take advantage of...
ekolis
1

votes
1

answer
219

views

Can I merge multiple consecutive changesets into a changeset in Mercurial

Let's say I have changeset A, and I make changesets B1, B2, and B3 on top of A, while another developer makes changesets C1, C2, and C3 on top of A: B1 --- B2 --- B3 / --- A \ C1 --- C2 --- C3 The other developer pushes his code to the central repository, and now I want to push my code, but I can't...
ekolis
20

votes
3

answer
24.2k

views

Where can I download the REAL MonoDevelop Windows binaries?

The monodevelop.com website just takes me to this 'Xamarin Studio' thing that has severe restrictions on the usage of the free version, and pricing that's almost as bad as Visual Studio on the paid versions! Is MonoDevelop for Windows dead? All I want to do is develop a GTK# application without inst...
ekolis
2

votes
1

answer
1.3k

views

How do I reference Microsoft.CSharp in a Portable Class Library?

I'm trying to use .NET 4's dynamic type in a Portable Class Library, but I'm having trouble getting all the required references working. I can reference System.Core just fine, but Microsoft.CSharp is giving me some trouble. It seems like I need to add all the different versions of Microsoft.CSharp.d...
ekolis
7

votes
1

answer
621

views

Is there a Python equivalent to the C# ?. and ?? operators?

For instance, in C# (starting with v6) I can say: mass = (vehicle?.Mass / 10) ?? 150; to set mass to a tenth of the vehicle's mass if there is a vehicle, but 150 if the vehicle is null (or has a null mass, if the Mass property is of a nullable type). Is there an equivalent construction in Python (sp...
ekolis
2

votes
2

answer
117

views

Is there a way to make the .NET Cast<T> extension method use user defined implicit cast operators? [duplicate]

This question already has an answer here: IEnumerable.Cast won't work even if an explicit cast operator is defined? 5 answers When I define an implicit cast operator, then attempt to invoke it on a whole collection of objects at once using the Cast extension method, I get an InvalidCastException. I...
ekolis
2

votes
2

answer
3.2k

views

Can't uninstall Xoreax Incredibuild Visual Studio addin

With some difficulty, I was able to uninstall Incredibuild (kept saying Visual Studio was open even when it wasn't), but it was unable to uninstall the Visual Studio addin (just said an error occurred when doing so in the log). The addin doesn't show up in Visual Studio's extensions dialog, and I do...
ekolis
2

votes
2

answer
1.7k

views

Eclipse gives “invalid resource directory name” when I add a non-resource PNG file to my Android project

I want to associate a PNG file with my Android project in Eclipse, but I don't want to actually publish it - it's just a higher-resolution version of the various icon.png files that I used to generate the icon.png files. But wherever I put this PNG file, I get the error 'invalid resource directory n...
ekolis
2

votes
1

answer
489

views

clr.AddReference and clr.ImportExtensions give an “expected type, got str” error

I can't seem to add a reference or import any extension methods in my IronPython scripts. For instance, with this script from one of my unit tests: import clr; clr.ImportExtensions('FrEee.Utility.Extensions'); from System import Math; x * y I get the error 'expected type, got str'. I tried removing...
ekolis
3

votes
2

answer
291

views

JSON.NET silently ignores circular references and sets arbitrary links in the chain to null to resolve them

I'm trying to serialize an object graph in JSON.NET in which a Galaxy contains StarSystems, a StarSystem contains Planets, a Planet contains a Colony, a Colony has an Owner, and the Galaxy also has a list of Empires, each of which has a list of explored StarSystems. So there's a circular reference...
ekolis
6

votes
1

answer
7.2k

views

require.js is not loading any modules

I am trying to load a module using require.js, and I have the following in my app.js: require.config({ baseUrl: 'js' }); alert('hello world'); // for debugging require(['eh2'], function(eh2) { alert('nothing here'); // for debugging }); When I run my application, though, despite the app.js being loa...
ekolis
7

votes
1

answer
2.3k

views

Is there any way to make Visual Studio auto-import necessary namespaces when implementing an interface?

When I tell Visual Studio to auto-implement an interface, it 'helpfully' tries to resolve any unreferenced namespaces - by prefixing every class in those namespaces with the namespace name! Is there any way to make it just import the namespaces with a using statement up top, instead of cluttering th...
ekolis
2

votes
5

answer
78

views

Two issues with Laravel view routing

I have this Laravel routes.php file:
ekolis
8

votes
6

answer
1.3k

views

Reflection can't find private setter on property of abstract class

When I have this property in an abstract class: public IList Components { get; private set; } Then when I call: p.GetSetMethod(true) with p being a PropertyInfo object pointing to my property, I get null. However if I change the property setter to protected, I can see it via reflection. Why is this?...
ekolis
2

votes
1

answer
146

views

VS2013 Express Test Explorer - how to expand all categories?

I'd like to view the tests in Test Explorer by class, but when I do so, even the ones that failed get hidden under the class categories, so I have to manually expand them all. I wind up just viewing them by status (pass/fail), but then they get all mushed together in one big long list. Is there any...
ekolis
2

votes
3

answer
666

views

How to sync XML comments between C# parent classes/interfaces and child classes

In Java, if I have a Javadoc on a parent class or interface, then the Javadoc appears in the context of a child class or interface in most IDEs when I hover over the child class name. However, this doesn't seem to be true in Visual Studio with C#'s XML comments. Is there any way to automatically syn...
ekolis
4

votes
0

answer
62

views

When overloading == in C#, is there a practical use case for overloading != as something other than “return !(a == b);”? [duplicate]

This question already has an answer here: Why must we define both == and != in C#? 13 answers I always wondered why you have to overload both; couldn't the implementation of != be built-in to call ==? Is there a reason where you'd want 'quantum indeterminate equality', if you'd like to call it that...
ekolis
2

votes
2

answer
278

views

Is there any advantage to declaring a class static in C#? [duplicate]

This question already has an answer here: When to use static classes in C# [duplicate] 11 answers In C#, you can declare a class as static, which requires all members to also be static. Is there any advantage (e.g. performance) to be gained by doing so? Or is it only a matter of making sure you don...
ekolis