Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Nostalgamus
Sep 28, 2010

I've got a problem I'm struggling to figure out, and my Google skills are failing me.

An old application I'm responsible for maintaining (VB.NET) has started getting "Access denied" errors when writing files to the temp folder. When the user showed this off, he also demonstrated how he got the same message when trying to save files to his Documents folder. I have been unable to reproduce this when running/debugging the application on my computer.

The symptoms make it seem like the application is not running with the user's permissions, but I'm not seeing a way that's possible. It generally doesn't need to run as administrator (anymore), and I didn't see any UAC popup when the user was demonstrating the error. Besides, if the application was running as a separate admin user, I assume it would use that user's temp folder instead (and the path in the error message used the regular username, as far as I could tell).

One of the weird things is this problem first appeared in march, and then vanished after about a week, before popping up again earlier this week. Windows updates have been a theory, but I don't see how that could mess with permissions.

Any ideas on what could cause something like this? It might technically be a Windows issue, not a .NET one

(Oh, and if anyone's wondering: Yes, the application gets Errors, because most of the code was autoconverted from VB6 and hasn't been touched since.)

Adbot
ADBOT LOVES YOU

Nostalgamus
Sep 28, 2010

I've been fiddling with async functions, and getting really confused.

Basically, I have an aspx page with a button. Clicking that button should run a call to a web service, which will usually take ~30min to run. The idea was to run this call asynchronously, i.e. start the function and return immediately, but that seems not to be working.

I'm using the auto-generated <FunctionName>Async() call from the web service (asmx file). It worked fine when testing with no input, the Completed event I attached correctly fired with an error message right away since the call had completed. Once I gave valid input, it starts running, and then basically makes the page hang until what I'm assuming is the timeout (about 5min).

At this point I started googling, and found some information that got me really confused. Apparently, using an *Async call is not asynchronous for that session? Instead it just return the thread to thread pool on the server - which I suppose is useful, but not what I'm looking for here. Debugging shows that the *Async() function call itself returns immediately, is it delaying the postback somehow?

Nostalgamus
Sep 28, 2010

mystes posted:

Uh, you're using await, right? If so, be aware that the whole point of awaiting an asynchronous function is that you want to resume the calling function when the result is obtained, so consider if that's what you really want to do here.

The Web Service appears to using the Event-based Asynchronous Pattern, so there's no Task object. As far as I understand, await needs one of those to work.

New Yorp New Yorp posted:

Your web service shouldn't take 30 minutes to run without returning a result. You shouldn't start a process in a web application that takes 30 minutes to run, ever, synchronously or asynchronously.

I was starting to suspect "the design is fundamentally wrong" was the right answer, so thanks for confirming that. I was starting so pretty early on due to the fact that the input parameter is a file path, i.e. the file in question need to already be on the server. In my defense, I did not create the Web Service, just got asked to make a web page that interfaces with it.

In either case, it seems to me like the best way to do this without major restructuring is to add a regular, synchronous function to the Web Service that starts a new thread for the big process, and then the web site can use the functions for checking progress (which were the main point of the web page).

Nostalgamus
Sep 28, 2010

Poking around in an old aspx application, and it looks like whoever made it originally has categorically used Server.Transfer() instead of Response.Redirect().

This came up because we had a case where a user used a form for creating new database entry, where the submit saves to a database and redirects user to an overview page. The user then got an error on the next page they navigated to, hit the back button, and ended up resubmitting the form - because the redirect had used Server.Transfer(), which does not change the browser URL, and by extension, not the browser history either.

I'm considering replacing all the instances of Server.Transfer() with Response.Redirect(), since it seems like the wrong function for general navigation. Which leaves me wondering what scenario one might actually want this behaviour.

Nostalgamus
Sep 28, 2010

I guess this is the most appropriate thread for MSI questions?

I have an old InstallShield installation that we have been using for years (without upgrading InstallShield, so the version is from 2005 or so). It mainly copies files, but there is also an MSI part of the install that handles Merge Modules.
Last week we were trying to install this on an Azure instance, and got a "Network location not found" error (Error 1606) - apparently for the Favorites folder in the user profile. The cause seems straightforward enough - the machine is set up for multiple regular users, with their respective OneDrive folders set as the User Profile folders. The installer requires admin privilieges, so we provide the credentials for an admin user - which does not have OneDrive configured, as that user should never need to use the machine in question.
As far as I can tell, we do not at any point attempt to add bookmarks to Internet Explorer, and to the best of my knowledge this folder has never been used for anything else. No part of the install should be referencing those folders, are they somehow required anyway?
There's also a separate - but likely related - bug where the dialog for selecting an install folder won't run when running as administrator (but works fine as a regular user).

My gut feeling is that we will need to configure User Profile folders for the admin user, either through setting up OneDrive, or reconfiguring the locations to be local drive folders for that particular user. However, I will likely have to argue with the customers IT department, and I don't think "a gut feeling" is sufficient argument.

Core questions:
Are User Profile folders mandatory, or is it possible to work around their absence?
If they are mandatory, is there any official documentation that states this?

e: Gut feeling was a good enough argument, and turned out to work.

Nostalgamus fucked around with this message at 18:45 on Aug 22, 2023

Adbot
ADBOT LOVES YOU

Nostalgamus
Sep 28, 2010

What's the current recommended library for reading Excel files? I'm having a hard time finding up-to-date answers to this.

I'm currently dealing with an issue where an excel import I set up a few years ago is importing incorrect numbers to the database. I'm currently using NPOI, but we've started seeing floating point errors when reading numeric value fields. I'm hoping a different library might avoid this, though we're also considering the possiblity of converting the columns to text before import.

Excel Interop is out, as I can't install Office on the machine.

Of course, there is probably grounds for asking questions about the numbers. 13-14 digits after the comma definetly implies somebody is using the wrong unit for the job. Also, the one field header I saw in the screenshots was in millimeters, which would imply a precision in a hundredth of a femtometer.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply