|
Bognar posted:This is kind of lovely since it's dodging your question entirely, but my recommendation is to avoid web services if you're just starting out with C#. They are basically legacy now and there's no real reason to start a new project with one these days. If you're trying to make something web accessible, then I'd recommend looking into ASP.NET MVC and Web API. The tutorials over at http://www.asp.net/web-api are decent enough to get started. Yeah, web services are double legacy. They were eclipsed by WCF services which were eclipsed by WebAPI.
|
# ? Dec 29, 2015 22:24 |
|
|
# ? May 22, 2024 16:54 |
|
Bognar posted:This is kind of lovely since it's dodging your question entirely, but my recommendation is to avoid web services if you're just starting out with C#. They are basically legacy now and there's no real reason to start a new project with one these days. If you're trying to make something web accessible, then I'd recommend looking into ASP.NET MVC and Web API. The tutorials over at http://www.asp.net/web-api are decent enough to get started. Fair enough, this also has the key advantage that it worked the first time I tried it, thanks!
|
# ? Dec 29, 2015 22:30 |
|
code:
This is not just happening in the Immediate window - the exception is thrown by my code. Seriously, what the hell is this? edit: I made a simpler case raminasi fucked around with this message at 05:54 on Dec 30, 2015 |
# ? Dec 30, 2015 05:38 |
|
A bug in the indexer for the Data property?
|
# ? Dec 30, 2015 05:46 |
|
GrumpyDoctor posted:
If you want to initialise IListProperty to an array then line 27 should be IListProperty = new [] { 1.0 }. If you want it to be some other collection type then you need to specify that. As-is, what you have there compiles to something like: code:
|
# ? Dec 30, 2015 12:23 |
|
I find it a good practice in general to ensure that my objects never have null-valued container fields.code:
|
# ? Dec 30, 2015 14:33 |
|
I swear I've checked this checkbox at least 100 times and it doesn't do a god drat thing.
|
# ? Dec 31, 2015 19:13 |
|
So it works about as well as the 'keep me logged in' check box or basically Microsoft's web login system in general?
|
# ? Dec 31, 2015 19:18 |
|
Munkeymon posted:So it works about as well as the 'keep me logged in' check box or basically Microsoft's web login system in general? Type in your email address and password to log in. Wait gently caress, you typed in your email address, did you mean an organizational account or a personal account? You don't know? Well gently caress you. Okay you clicked one, hold on while I bounce you through 10 redirects to login on a different page.
|
# ? Dec 31, 2015 19:27 |
|
Or when you get bounced out to a login page but don't notice during the minutes it's valid. Now there's an error message about something being invalid? Well I'm sure that doesn't confuse anyone ever.
|
# ? Dec 31, 2015 19:50 |
|
Works On My Machine
|
# ? Dec 31, 2015 20:18 |
|
Ithaqua posted:Works On My Machine The mark of quality code.
|
# ? Dec 31, 2015 21:34 |
|
Ok I see you are logging in from a new device. We're going to text you a code or maybe an email. We can wait while you run to another device to check that code.... I hope you don't have alzheimers! OK you got the code and you managed to enter it correctly. Great! Please wait while we forget what page you were on and redirect you back to the beginning. We'll probably ask you to login again.
|
# ? Dec 31, 2015 22:41 |
|
crashdome posted:Ok I see you are logging in from a new device. We're going to text you a code or maybe an email. We can wait while you run to another device to check that code.... I hope you don't have alzheimers! If you have two factor auth setup without a really quick and easy way to access the codes you need, you kind of deserve to be jerked around imo
|
# ? Jan 1, 2016 02:37 |
|
crashdome posted:Ok I see you are logging in from a new device. We're going to text you a code or maybe an email. We can wait while you run to another device to check that code.... I hope you don't have alzheimers! Ok I see you are logging in from a new device in bed in the middle of the night and your two-week old baby has just fallen asleep. We've sent you an SMS! Now you must race against time to put your phone on silent before it makes a big-rear end sound and wakes up the whole family.
|
# ? Jan 1, 2016 03:15 |
|
Squall posted:If you have two factor auth setup without a really quick and easy way to access the codes you need, you kind of deserve to be jerked around imo I want to live in your world where you can supposedly turn off that feature.
|
# ? Jan 1, 2016 20:59 |
|
GrumpyDoctor posted:I'm having a weird AutoMapper problem. Mapper.AssertConfigurationIsValid() succeeds, but all my actual mappings are failing with "Missing type map configuration or unsupported mapping." As an example: I'm mapping a Source.GlazingMaterial to a Destination.GlazingMaterial, but the mapper, in a child mapping, then tries to map the source object itself to an Int32 field, which obviously fails. I don't know which one, because neither type even has any Int32 fields. Something like this is happening with every type - the mapper tries to map the source object itself to a field on the destination object (which may not even exist). Calling Mapper.Reset() before establishing my mappings doesn't fix the problem. Is there any way to ask AutoMapper wtf it thinks it's doing?
|
# ? Jan 3, 2016 18:57 |
|
Destroyenator posted:Wild guess, is the Mapper.AssertConfigurationIsValid in the same build mode (debug/release)? Anything funky with the models being in assemblies targeting different runtime versions from the call site/tests? The call to Mapper.AssertConfigurationIsValid is in the same assembly as the map definitions and the actual calls to Map, so I don't think that's the problem. I could double-check the runtime versions of all relevant assemblies, but I discovered that it's not actually all types, just the first few that I tested. I switched those to manual mapping and everything seems to be "working" now.
|
# ? Jan 4, 2016 03:32 |
|
Weird. Any chance it's generating a parent class mapping that's getting selected so the child specific fields aren't recognised?
|
# ? Jan 4, 2016 08:18 |
|
Destroyenator posted:Weird. Any chance it's generating a parent class mapping that's getting selected so the child specific fields aren't recognised? The types of the fields it's trying to map to don't match any types of any properties anywhere within the destination class hierarchy. I have no idea where they're coming from.
|
# ? Jan 4, 2016 08:22 |
|
I'd like to see the ICompileModule feature from DNX be supported on other platforms.
|
# ? Jan 5, 2016 01:16 |
|
I'd like to use the same text in generated documentation files and actual help text used when my application runs. Is there an elegant way to do this?
|
# ? Jan 5, 2016 06:23 |
|
Okay, I have managed to write down all my relevant learnings about NuGet packaging in the modern way. Phew, that was more effort than I expected!
Comments very welcome! Code is on GitHub. Trying out this SO self-answered questions format. Yay, already one vote to close from some jerk who didn't even read my text! EssOEss fucked around with this message at 12:33 on Jan 6, 2016 |
# ? Jan 5, 2016 13:49 |
|
I'd like to highlight words in a word document that match a given regexp, and eventually turn them into merge fields. Currently the script I came up with correctly identifies the words I'm looking for but the highlight is all over the place, and I commented out the merge fields part because it's not ready yet. code:
e: updated script, it highlights like I want it to but replacing the hilighted words with mergefields doesn't work reliably. unpacked robinhood fucked around with this message at 17:07 on Jan 6, 2016 |
# ? Jan 6, 2016 11:20 |
|
This is probably a long shot, but here goes: I want to save emails relevant to projects in our ERP system. We don't actually want to save the actual emails but a link to them. Does anyone know if I can use the EWS api in Exchange to get a link to an email that when the user clicks the link it will open the email? Sort of like how saving the URL of a PDF saved on SharePoint will open Acrobat and the corresponding PDF file.
|
# ? Jan 6, 2016 13:58 |
|
Inverness posted:
They are in the context of finding an answer out later to a question you were legitimately asking. e: Kekekela fucked around with this message at 18:44 on Jan 6, 2016 |
# ? Jan 6, 2016 16:03 |
|
http://stackoverflow.com/help/self-answerquote:Stack Exchange has always explicitly encouraged users to answer their own questions. If you have a question that you already know the answer to, and you would like to document that knowledge in public so that others (including yourself) can find it later, it's perfectly okay to ask and answer your own question on a Stack Exchange site.
|
# ? Jan 6, 2016 17:25 |
|
Anyone else think it's be nice to have a "Only break on uncaught exceptions in files currently open in the editor" option? Getting sick of closing tabs I don't want open just because something I didn't break and can't fix is failing off in the corner over there.
|
# ? Jan 7, 2016 19:32 |
|
Munkeymon posted:Anyone else think it's be nice to have a "Only break on uncaught exceptions in files currently open in the editor" option? Getting sick of closing tabs I don't want open just because something I didn't break and can't fix is failing off in the corner over there. I would love either something like that, or "Break on uncaught exceptions if THIS METHOD RIGHT HERE is in the call stack".
|
# ? Jan 7, 2016 21:54 |
|
Ithaqua posted:Yeah, web services are double legacy. They were eclipsed by WCF services which were eclipsed by WebAPI. That depends on who you ask. The ongoing debate at my job here has been WCF vs. WebAPI, with pretty good arguments on either side. Basically, WCF still has a place where you can use NetTcpBinding or whatever. Honestly, it's moot as far as I'm concerned because I want exposure completely divorced from the service business logic, anyway, so that my WebAPI/WCF is just wrapped around a DLL.
|
# ? Jan 8, 2016 15:41 |
|
Finster Dexter posted:That depends on who you ask. The ongoing debate at my job here has been WCF vs. WebAPI, with pretty good arguments on either side. Basically, WCF still has a place where you can use NetTcpBinding or whatever. Honestly, it's moot as far as I'm concerned because I want exposure completely divorced from the service business logic, anyway, so that my WebAPI/WCF is just wrapped around a DLL. WCF as a web service is what I mean. If you want to use it for TCP or MSMQ binding, that's a different purpose.
|
# ? Jan 8, 2016 18:26 |
|
Ran into something weird at work and wanted to see if the forums collective wisdom can help: Note: This is on Windows 7 x64 and VS2012 Update 5 I'm writing some unit tests for a WebApi controller (which is in an Mvc Project), and I discovered that the base class is making a call directly to HttpContext.Current. Ok, not problem, we are using Autofac and I have some experience with Ninject binding HttpContextBase to return HttpContext.Current so I take a peek to see if there is a "preferred" way to do this. Turns out there is! Autofac.Mvc5. I open up my package manager and paste the install command and get this output: code:
I tried going to NuGet settings and clearing the cache but that didn't seem to buy me anything. This is pretty strange. Anyone see anything like this before? We are making the switch to VS2015 next week but I'm not fond of just waiting for that if I can fix this in the mean time. Anyone see something like this before? As I mentioned before the tests are for a WebApi controller that is using a base class that seems to be used for all controllers. Autofac.WebApi2 is installed to the project and I can use it but it doesn't seem to have the Autofac module (AutofacWebTypesModule) that I need to register.
|
# ? Jan 8, 2016 21:35 |
|
I've never seen that before. What does your packages.config look like? Is Autofac.Mvc5 in there? (guess not if a solution wide search doesn't find it) Is it in the packages directory for the solution? Is your Nuget exe and tooling up to date for VS2012? It sounds like something is cached or corrupted somewhere, though.
|
# ? Jan 8, 2016 22:45 |
|
What do you guys do when you're building software to sell and you use 3rd party libraries via nuget eg. Autofac, elmah, EF etc. Is there a recommended practice for including licenses for these? With the javascript libraries, the license is usually included as part of the .js file, so I think I'm OK there, but for all these other packages I've just created a "licenses" folder, which contains files named like the package name - "autofac.lic", "autofac.mvc.lic" and copied the license from their github or wherever I can find it into the corresponding .lic file. This folder will be included as part of the distributed software. I normally develop inhouse apps that are not for distribution, so this has never come up before and I'm not sure what approach to take.
|
# ? Jan 9, 2016 00:33 |
|
Edit: nevermind
EssOEss fucked around with this message at 15:36 on Jan 9, 2016 |
# ? Jan 9, 2016 10:37 |
|
Finster Dexter posted:I've never seen that before. The packages.config for the project I want to add it to does not contain a reference to it. When I checked the Packages folder for the solution, however it DID contain Autofac.Mvc5.3.3.4 and when I saw this I checked the repositories.config and went through each of the referenced packages.config but none of them contained a reference to Autofac.Mvc so I deleted the folder there and was able to install the package to the project. Not sure how it ended up there because I double checked and it's not coming from source control. Thanks for pointing out to check the packages folder!
|
# ? Jan 11, 2016 14:13 |
|
I keep running into the same ASP problem. Generally my ASP solutions are structured like this:
FooCore is "The Application". FooAsp is pretty thin, and depends on FooCore to get the real work done. If I wanted to, I could write other interfaces like FooConsole or FooWpf. FooCore.Tests, as expected, depends on FooCore and runs my tests. I want to take advantage of user management via the Identity framework, which does registration, login, password hashing, password resets, authorization via roles, authentication via cookies (mvc) and tokens (webapi), and more. I really, really don't want to write and maintain these things myself. However, the ApplicationUser class is sitting in a UserContext in FooAsp, and all my other entities are sitting in DataContext in FooCore. Here's an example of the problem. Say I wanted to add a feature that sends users text messages based on events that occur in FooCore. I want to build a testable class in FooCore that interfaces with (for example) Twilio, with restrictions on how many messages per second it sends, logs who it has sent messages to, records failures, etc. FooCore doesn't know about FooAsp (ie doesn't know about ApplicationUser). What I've done in the past is write my own User entity in FooCore that maps 1:1 with an ApplicationUser in FooAsp, but this is a pain to keep synchronized (and redundant to keep two user tables in literally the same database). How can I deal with this properly?
|
# ? Jan 11, 2016 16:23 |
|
epalm posted:I keep running into the same ASP problem. Create another project and reference it from both Asp and Core?
|
# ? Jan 11, 2016 16:34 |
|
|
# ? May 22, 2024 16:54 |
|
epalm posted:I keep running into the same ASP problem. Personally I would typically render unto the framework what is the framework and keep my own copy of the user data I cared about. There might end up being minimal duplication of data as the framework might need email for mechanical purposes and I'd need email for marketing purposes but I'd rather control my data and be able to use it without needing to keep the same tables working with the framework's mechanics. The bridge I used to use was a ProviderUserKey setting under the old membership stuff, I'd suspect there is an equivalent in the new Identity stuff but I haven't been down that path recently.
|
# ? Jan 11, 2016 17:59 |