Whenever I attempt to read a PDF via OCR, it works correctly when running locally on my development machine, and all text parses correctly. However, the same code (and same license) in our remote server is reading blank text.
In the screenshot below, this is a remote debugger attached to the server and while I've confirmed it does read the file correctly (into fileBytes), invoking ReadPdf reads an empty string for text and finds no pages.
I'm not sure what can cause. I have checked folder permissions in Temp, set a custom temp directory, and still it reads blank. It also shows the same behavior when reading TIFF files (ReadMultiFrameTiff(...)) even when a file path is used in the parameter.
Note: PdfReader is another library that is only used to get the page numbers.
Thanks!
In this case, the solution was updating the Visual C++ runtimes (both x86 and x64) on the remote server. Apparently the remote server did not have the latest version installed.
These other suggestions were from their support ticket that I had tried prior to updating the runtimes:
Please also set an installation path that has full permissions to the IIS user: https://ironsoftware.com/csharp/ocr/object-reference/html/T_IronOcr_IronOcrInstallation.htm
It could also be that something could be missing in the DLL assemblies. Please try to clear all cache and temp folders, then download the package again into a CLEAN app.
Related
I am using C#.net for application development.
To log and debug exceptions, I use the stacktrace.
I executed my application on another machine, but when errors occur it refers to the path of my development machine.
Ex: D:\Projects\xyz.CS line no :12 _Error_message_here.
Why does it trace to the path on my development machine path even though I am running the application on another machine?
The original compiled path is stored in the debug information within the PDB files.
Because it's telling you where to find the problem in your source code. So when you see this, you can go to your machine and open the file reported (e.g. "D:\Projects\xyz.cs"), go to the reported line (e.g. 12) and fix the problem.
Explanation
When you do a Debug build, it includes source information in the compiled files to enable debugging, e.g. pause, step over, etc.
Solution
If you don't want the source information to be included perform a Release build and deploy that to the other machine.
I have deployed my application to be ready for use by another user (another computer), but when I try to add the data to the database I get the error
Operation must use an updatable query
The error is like this (This is when I already deployed my program and run under application, not under Visual Studio):
But it works perfectly under visual studio, the image like this (note that, the error on the image above appear once I click the submit button, it supposed to stored in the database, and display it on the datagridview as like image below):
And also I got another problem, the delete function is not running, the error on the add and delete appear once I deployed my program, but I will post that on another thread.
How do I solve this?
When a Visual Studio application is under development it resides in a folder to which the developer has read/write access. This is obviously necessary since the developer needs to be able to edit the source code files. If you place a database file "in with the code" then the application can update the database file because it is in a "writable" location.
However, if on deployment the database file stays "with the code" and the installer puts the files (i.e., the executable file and the database file) into %ProgramFiles% on the target machine (for example, C:\Program Files\MyApplication) then the average user will not have write access to that location. Files in %ProgramFiles% are normally restricted to read-only to protect the system from malware.
Some people will try and configure the installer to grant write access to normal users for some file(s) or folder(s) under %ProgramFiles% but that is a Bad Idea™. The installer should really copy the database file to a location that is normally read/write for the intended user(s): either %USERPROFILE% (for a specific user), or %PUBLIC% (for all users).
I am getting
"Creation of virtual directory http://localhost:30852/ failed with the error: Filename: redirection.config Error: cannot read configuration file"
while opening webapi project. Someone else created on their machine and I am downloading from TFS. It works fine on their machine.
I have installed latest .net framework and I have IIS installed on my local machine.
I already tried opening Visual Studio as admin, but no use.
There could be a couple of things gone wrong here.
1) I've seen the problem occurs that TFS ignores an item from checking in or completely removes them from the being part of source control.
If this is the case, let your college re-add then to the source control and commit.
2) check on your college's machine. If the file is actually marked as part of the commit and if it's committed. If both seem fine, make sure the version on your local repo is correctly pulled from TFS.
Depending on what version control (git or TFS) you are using your files are by default located at: C:\Users\%username%\Source
3) There is a difference in the redirection config you and your college are using. You might already have the other application registered at this path in your application host config.
The config can be found at Documents\IISExpress\config simply compare this config with your colleges. If you have a conflicting configuration you can change it to a different port.
As last resort, you could simply copy over the redirect config from your college and see if this fixes the problem.
I've got a Windows C# program that I want to extract a file (or directory) from a .tgz file without compromising the integrity of the .tgz file. This file comes from a linux system and has permissions set on it and what I need to do is remove a directory from it, and then send it to another linux machine to run. I tried using the Chilkat component but it removed all the permissions and casing on the sub folders so it wouldn't run on the other linux box.
Any suggestions as to how I can do this (if it can be done on a Windows machine using C#) would be greatly appreciated.
Have you tried to use sharpziplib, I have used it in the passed with success
I have deployed an app that downloads from a web server. This is a normal desktop app installed using a msi produced by Visual Studio setup project. The address of the server is stored in app.exe.config as an application setting. Later, I change the address in app.exe.config using notepad, but the app is still using the old web address. In fact, I tried deleting the app.exe.config and the app still managed to get the old web address?????
Can someone explain what is happening.
Sorry if it confused some people. The settings are managed using the C# project's properties -> Settings page. The project is called updatesdownloader and the actual file I edit is updatesdownloader.exe.config which is in the same folder as the exe.
The code I used to read the server address string is:
Server updateServer = new Server(new Uri(UpdatesDownloader.Properties.Settings.Default.Server));
Where is the file that you are changing? Is the setting a user setting or an application setting?
You may want to look for your settings in the %AppData% or %ProgramData% folders on the user's machines.
You need to us ConfigurationManager.RefreshSection for a custom section that contains your settings.
Check this for an example on how to create a custom section
Are you sure the address is not hard-coded in the app itself? I would be sure that if you made reference to a URL using ConfigurationManager.AppSettings["SomeUrl"]; and attempted to go there, it would fail if the file did not exist.