|
Having a really weird issue here, that I'm not even sure how to google for or dive into to see what is going on. Have a recordset being returned from MSSQL that I'm loading into a DataTable. When I try to populate a string with one of the data fields the DataRow is showing that field is an empty array (so, db NULL I think) so it throws an error. The thing is when I run that stored procedure in SSMS the returned record most certainly has data in that field. If I wrap that output field in the stored procedure with an ISNULL(result, ' ') then the DataRow shows the data = ' ', even though in SSMS that data is not NULL in the result table. Not really sure where the error is occurring. The ISNULL check makes me think in MSSQL but there's data being returned in the result set, so maybe it's in the DataRow? Any insight or where I can start looking for a solution would be most appreciated.
|
# ¿ Oct 30, 2017 22:16 |
|
|
# ¿ May 17, 2024 17:12 |
|
Pilsner posted:This is very hard to understand for me. Can you give some code samples? What do you mean "try to populate a string with one of the data fields the DataRow is showing that field is an empty array"?? Yeah, sorry, wasn't sure how clear that was code:
It's probably not really an empty array but how VS displays NULL because that's the error being thrown (can't convert null to string) Munkeymon posted:Your database driver might be setting an option that causes some operator to act differently than SSMS. Try running select @@options through both your driver and SSMS and see if they're different. Thanks for this, not sure if it helps yet but it's a place to start looking at least. The settings are different, now to see if it makes any difference syncing them up.
|
# ¿ Nov 1, 2017 14:34 |
|
Is there anything that updating to the latest version of Windows 10 would make this code now return a different value from what it was returning a couple of weeks ago (or on an entirely different computer running Windows 7, they used to match)code:
|
# ¿ Feb 12, 2018 17:56 |
|
EssOEss posted:I see one thing here that might be different between the machines - whatever is in "data"! Fair enough, I just wrote this to test it on each system code:
This is used to create some salts so it actually calls another function to garble up some of the input ("data" variable in my previous post), so to mimic part of it I added the .Reverse() part up above and this is where the output differs between Windows versions Windows 7, VS 2015, .NET 4.5.2 code:
code:
edit: If I just run this code: code:
Windows 7: code:
code:
Just-In-Timeberlake fucked around with this message at 21:34 on Feb 12, 2018 |
# ¿ Feb 12, 2018 21:10 |
|
EssOEss posted:Oh! If you print out your "data" variable after .Reverse().ToString(), you will find the reason for your conundrum: Ok, I can work around that, thanks for pointing me in the right direction. Any idea why one is different than the other between Windows versions?
|
# ¿ Feb 12, 2018 22:10 |
|
redleader posted:How sure are you that data is the same between the two systems? Could there be some invisible characters (e.g. non-breaking spaces) in one of them? You could try comparing a hex dump of the two strings. I literally copied and pasted from one VM to the other, can't see how something extraneous got in there. Anyway, the problem is solved, I'm just curious why the <ReverseIterator> type returned is different between Windows versions.
|
# ¿ Feb 12, 2018 22:37 |
|
I guess this is a .NET question? If not, let me know. I have a .netCore AWS Lambda project and I was wondering if there's a way to have different deployment config files (like in ASP.NET, web.debug.config, web.release.config) so I can deploy to different Lambda apps? Like have the following files: aws-lambda-tools-defaults.development.json => deploy to dev aws-lambda-tools-defaults.staging.json => deploy to staging aws-lambda-tools-defaults.production.json => deploy to production or using the serverless.template file? I can't quite seem to find the documentation I need for this.
|
# ¿ Oct 1, 2020 14:41 |
|
adaz posted:dotnet lambda deploy-function -C staging exactly what I was looking for, thanks
|
# ¿ Oct 1, 2020 18:56 |
|
Riot Bimbo posted:At some point in September, my brain finally clicked into place and began building new routines to replace covid-destroyed ones. To add to the previous answer, check out this blog post with links to a git repo https://medium.com/@michaeldimoudis...er-6d31cdd6d3f5 The git repo code will handle all the grunt work to spin up a serverless AWS Lambda/CloudFormation stack with a CloudWatch lambda warmer to keep the functions from going dormant. You get something like 1M lambda function calls/month so it won’t cost anything. Spin up a cheap/free RDS instance and you can work on your database integration. AWS Lambda makes API development a cinch.
|
# ¿ Oct 14, 2020 00:12 |
|
Riot Bimbo posted:I feel like a doofus but I am not at a point where this blog post provides enough info to get this running properly right off the bat. I think I'll go a little meta and endeavor to learn how to understand what the hell I'm doing here. That's the best I can do, since this is kind of the direction I wanna go. You can download the code and just run it locally with no extra configuration and use Postman to test your code. When you want to get to the point of spinning up a serverless stack on AWS you can mess around with the config files (it’s actually not as hard as it seems)
|
# ¿ Oct 15, 2020 02:34 |
|
Is there a way to get either the HttpContext or just the URL in the Startup.cs of a net core api? I'm trying to load a different configuration based on which environment it's deployed to (ie. dev.mysite.com vs. staging.mysite.com). One wouldn't think this would be such a pain in the rear end, but gently caress me if I can't figure it out.
|
# ¿ Nov 4, 2020 17:50 |
|
Anybody have any Serilog knowledge/experience? I have Serilog working locally (sends logs to Elasticsearch), but when I deploy to AWS Lambda, I am getting the following error in the Cloudwatch Logs: System.InvalidOperationException: Unable to resolve service for type 'Serilog.Extensions.Hosting.DiagnosticContext' while attempting to activate 'Serilog.AspNetCore.RequestLoggingMiddleware Any ideas what the issue could be? Kinda hard to debug this.
|
# ¿ Nov 4, 2020 22:00 |
|
adaz posted:I only use serilog for a bit before I swapped to NLog, but that looks like you didn't properly setup Serilog. In your app.startup for the 'cloud' config or whatever you use for your lambda are you UseSerilog in your host builder?. I took a look at that third party extension you're using and its just expecting that Diagnostic Context to already be there, and it's not I think I've got it all set up right looking at that, otherwise I don't think it would work at all, but it does work on my dev machine. I decided to pare it down to the basics, I removed anything to do with Serilog except the base Serilog.AspNetCore package, and used the most bare bones configuration necessary to log something, and I'm still getting the same error. LocalEntryPoint.cs: code:
code:
|
# ¿ Nov 5, 2020 15:06 |
|
iirc SQL Server will happily use the maximum resources you give it
|
# ¿ Nov 11, 2020 02:27 |
|
GI_Clutch posted:For example, let's say I built some kind of swiss army knife console application with a variety of utilities in it. The user is presented with with a menu to select the task they would like to perform. Each of the various tasks does something completely different with its own set of dependencies (maybe they hit different database models, work with Windows services, read/build flat files, etc.) In this situation, there is a single entry point. I don't know what is going to be needed until the user makes a selection. lol'ing hard because I made an application for work that does exactly this and named it Swiss Army Knife (SAK because I'm a child ) I have no real insight as I made it out of a necessity to get some things quickly done so I'm sure anybody looking at the code would consider it a mess.
|
# ¿ Dec 7, 2020 17:33 |
|
Hammerite posted:drat, it does the right thing on net core 3.1 as well. Just Framework where it doesn't. Unfortunately the place where I wanted to do this is a framework app. Well, I will just have to do without. Create a .dll in netCore or .NET 5 that does what you want and reference it? I’ve managed to make things work that way when there was no way to switch to a higher framework that supported TLS2.1
|
# ¿ Aug 28, 2021 21:05 |
|
I feel like I'm missing something simple here, but not sure what. I'm trying to use an online service to convert HTML to PDF, and then return a base64 encoded string of the pdf. I can make the call fine, but when I put the returned base64 string into a decoder, I'm only getting like the first 20% of the pdf, the rest is blank. Using Postman and hitting the HtmlToPdf api directly returns the full pdf. Looking at the base64 string, there's a section of "AAAAAAAAAA......etc" in there, so obviously something is going wrong in the encoding. I suspect it's that I'm encoding the entire response and not just the .pdf part, but I'm not sure, or how to get just that part. Here's the code for the call:code:
|
# ¿ Sep 14, 2021 15:14 |
|
I rewrote it using HttpClient and it works now, go figurecode:
|
# ¿ Sep 14, 2021 18:41 |
|
Thanks for the heads up on all that.insta posted:Glad they didn't waste too much time making the esoteric thing of "web requests" too easy. for real, there's like 20 different ways to do the same thing.
|
# ¿ Sep 16, 2021 14:47 |
|
LongSack posted:Umm so am i doing this wrong: according to everything I read today to make the switch to HttpClientFactory, this will eventually bite you in the rear end, with the bonus knowing that going by the documentation, you're doing the right thing.
|
# ¿ Sep 17, 2021 00:07 |
|
Supersonic posted:I'm writing an api wrapper and am currently trying to deserialize this JSON response: http://data.nba.net/json/bios/player_201935.json I’m not near a machine to mess with it so I can’t help with the null issue, but you should stop doing what you’re doing with the HttpClient before you get too far along and it becomes a real pain in the rear end to fix. https://www.aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/
|
# ¿ Dec 31, 2021 15:37 |
|
Any ASP.NET experts here? Particularly with the web.config and IIS10? We have a custom error page to handle any errors, and we need that initial form data to go along for the ride. This works when deployed to our old Server 2012 instance on AWS, and run on localhost via Visual Studio and IISExpress on a Server 2019 machine: code:
I feel like I'm missing some setting in IIS10, but Googling isn't bringing anything up.
|
# ¿ Jan 21, 2022 15:29 |
|
Can anybody provide some insight as to why this FileSystemWatcher code won't fire on change or rename events, but works just fine for the created event? This folder is an FTP folder (network share, maybe that?) that customers upload files to, there's a delay before processing since some files are large and I want the files to be fully uploaded before trying to process them. I need the rename/change to fire because some FTP clients will upload with a .filepart extension, which then gets changed to the actual filetype extension, which then throws an error because the e.FullPath still has the .filepart extension on the raised create event but that file no longer exists so you get a System.IO.FileNotFoundException. Or maybe there's some other way to deal with that scenario I'm unaware of. code:
code:
Just-In-Timeberlake fucked around with this message at 15:57 on Jan 31, 2022 |
# ¿ Jan 31, 2022 15:37 |
|
Ok, how the gently caress do you get the request body in a .netCore3.1 api controller? Or just the form part of the request body. Everything I'm finding online starts and ends with saying to add this to startup.cs code:
I can assign the context in the app.Use() part to a static class variable and access it from anywhere, but that seems like the world's second worst idea, only bested by getting involved in a land war in Asia. Jesus gently caress it should not be this hard.
|
# ¿ Feb 3, 2022 15:39 |
|
Kyte posted:ControllerBase has Request which has both Form and Body? Well I feel dumb, mainly because I thought it wasn't going to work because VS2022, while often amazing, also slaps red squiggly lines all over valid poo poo. Did a rebuild and the lines went away. Thanks, I'm a dope.
|
# ¿ Feb 3, 2022 16:30 |
|
I'd just like to say it's pretty amazing what an absolute pig VS2022 is when it comes to resources.
|
# ¿ Feb 3, 2022 19:23 |
|
riichiee posted:I've got a WPF .NET Framework application that needs to be distrubuted externally. I currently do this by publishing the app to an Amazon S3 bucket, but that'll probably give you the same issue as using an Azure blob solution. Are you signing the ClickOnce manifests? Pretty sure our users only have to explicitly allow it on the first install, after that it just runs/updates without issue.
|
# ¿ Feb 16, 2022 13:29 |
|
fuf posted:ok so I should probably just come up with my own little logging service lol no, don't try to reinvent the wheel, I guarantee what you want exists already. Here, check this out using Serilog: https://stackoverflow.com/questions/35567814/is-it-possible-to-display-serilog-log-in-the-programs-gui
|
# ¿ Feb 25, 2022 14:21 |
|
rarbatrol posted:Man I wish we had performance problems as subtle as that. I'm dealing with legacy code continuously being glued together in new and terrifying ways, and we keep finding code that performs a database lookup per record, which itself usually comes from an initial database lookup. ah, you’re me, good to know.
|
# ¿ Mar 6, 2022 22:25 |
|
fuf posted:I'm trying to test a .net app using my phone so I want to access it via the local network. Doesn't the HTTPS endpoint need to be on a different port? In ASP.NET in the applicationhost.config you need something like this: code:
|
# ¿ Apr 12, 2022 17:27 |
|
zokie posted:I would really like to make the application window me an exotic shape. There are easier ways to make Winamp skins
|
# ¿ Apr 29, 2022 04:17 |
|
Hammerite posted:Visual Studio on my work machine is frequently getting itself into a state where it doesn't acknowledge certain keyboard inputs. It accepts printable characters, but it won't react to (for example) the enter key, the delete or backspace key, function keys, or combinations of meta and regular keys. The only way to fix it is to close and reopen VS. Anyone else had this? What version? Used to happen to me on 2019 but I can't recall it happening since I upgraded to 2022.
|
# ¿ May 4, 2022 19:52 |
|
LongSack posted:CORS question. Use your browser tools to start looking at the request/response header info, try multiple browsers since they might say slightly different things that might lead you to the solution. I've had this nonsense happen, and IE11 of all things gave me a message (that no other browser did) that was the clue I needed.
|
# ¿ Jun 1, 2022 15:54 |
|
worms butthole guy posted:So I tried the above suggestions and I think I got closer to what I was trying to accomplish...I think. And i'm stuck again . So I ended up with: shouldn’t that be Beat == beat?
|
# ¿ Nov 12, 2022 05:19 |
|
epswing posted:Tell me about your favourite HTML -> PDF converter! I haven't had to do this in a while, notably since the shift from .NET Framework to .NET Core. Has the dotnetcore community gravitated towards a particularly good solution/library? Or is using a 3rd party service the way to go these days? We use https://www.api2pdf.com/, cheap, fast, and accurately renders the HTML => PDF, and the generated PDFs get stored in an S3 bucket. They have SDKs for python, node, php, c# and java and several different rendering engines to choose from: https://app.swaggerhub.com/apis-docs/api2pdf/api2pdf/2.0.0
|
# ¿ Dec 11, 2023 17:00 |
|
|
# ¿ May 17, 2024 17:12 |
|
Surprise T Rex posted:What's the state of the art for creating PDFs in C# code now? Ideally one I can run from a serverless Azure Function or AWS Lambda. At work we do some of this using rendering Razor templates to HTML and feeding it to Puppeteer(?) to basically fake a print-to-PDF, but that requires us to run it as a docker container so we can bundle a headless Chrome with it and that seems like more effort than is necessary. I recommended api2pdf a few posts up, I still recommend it. It costs next to nothing (we generated ~50k pdfs in December, cost ~$30), multiple converters and .pdf utilities to choose from, and I don't have to maintain poo poo. https://app.swaggerhub.com/apis-docs/api2pdf/api2pdf/2.0.0 I found the Wkhtmltopdf converter to do the best job in accurately converting HTML to a .pdf Just-In-Timeberlake fucked around with this message at 14:08 on Jan 9, 2024 |
# ¿ Jan 9, 2024 14:05 |