I need to use the PDF.Convert.ToXod but this exception comes - c#

I need to use the pdftron.PDF.Convert.ToXod but this exception comes:
Message: An error occurred while converting the file.Detailed error:Error creating a new Word application instance.Log: Start check system account. Session ID is: 0. Done checking system account. Start checking registry. Registry check done. Creating a Word application instance. Conditional expression: false Filename : Convert.cpp Function : trn::PDF::Convert::ToPdf Linenumber : 1612
This function is called in an mvc website running on application pool in IIS.
The user for application pool is administrator.
i notice when i call this method from WebAPI function it throws this error, howerver if the same method is called from browser with a validated user the code works and also subsequent request to the api also start working.
the api function is without user identity [AllowAnonymous].
Please kindly help me find a reason so i can fix it. Its because i cant manually go and call this from browser every time application pool restarts the website, i want that if api calls this first , then it be successfully done , i also tried to call PDFNet.Initialize function at global.asax , it does nothing different.

The following links will probably help you.
https://www.pdftron.com/pdfnet/faq_files/Converting_Documents_in_Windows_Service_or_ASP.NET_Application_using_PDFNet.pdf
https://groups.google.com/d/msg/pdfnet-webviewer/F5SdHgb__1w/PSjoj22qCwAJ
Or try the test project to validate your IIS setup.
https://www.pdftron.com/ID-zJWLuhTffd3c/support/PDFNet_IIS_Word_ToXod_Test2013.7z

Related

How to solve open id configuration error with identity server 4?

I am trying to use Identity Server 4 for Authenticationa and authorization purpose but which ever project i try to run is throwing only 1 error which is like bugging me alot because i have search for this error and i cant find a stable and proper solution for this.
Error :
Error connecting to
http://localhost:5000/.well-known/openid-configuration: An error
occurred while sending the request.
Couple of projects in which i am getting same error and dont know how to solve it :
https://www.dropbox.com/s/9hs3huwt8h035ek/oauth2Demo-master.rar?dl=0
Another Project : Download but same error
In my first project it seems like there is some problem related to SSL certificate though i tried to follow below link to install certificate but still this error exist :
https://github.com/IdentityServer/IdentityServer3.Samples/tree/master/source/Certificates
But in my second project there is no such SSL certificate problem but still same error.
Is there any way to resolve that error?
I downloaded the solution and I can confirm you need to make sure to run the OAuth2Demo.IdentityServer project, you can actually start it up and navigate to https://localhost:44305/admin/ to see the admin environment of identityserver. It apperantly also needs a sql connection to store configuration information, I didn't dig into those details but with the OAuth2Demo.IdentityServer running the other projects can also be started.
My suggestion is to get the things done one by one.
From your screens I see that on the first you are trying to reach IDS at localhost:44305, and on the second screen, you are trying to reach it at localhost:5000. It will be a good thing to set it as a constant value ( right click on your Identity Server project ->Properties->Debug->Web Server Settings->App URL) and then use this value through all of your clients.
Then - enable Identity Server logging - check here. You can extend this example - serilog basic configurations. So far logging has saved me many times, so I can say that it is really important. Make sure that the App pool account, running the application has the rights to create files, where you want them to be created.
Now the real problem:
Lets assume that you select localhost:5000 as url for your IDS.
First of all start (debug) only the Identity Server project. This should take you to localhost:5000 and you will see a welcome message from Identity Server 4.
If you see it, this means that your IDS is working. This also means that you will be able to access the Discovery Document - the one thing that is failing in your clients. Now its about time to setup your clients.
If not, this means that there is something wrong with your Identity Server instance, and that is the place to dig.
First thing I'll do is to check the logs. They will say what the problem is.
Then - I figure out that you are trying to use custom certificate for this (correct me if I've misunderstood). Why don't you try using the Developer Signing Credential (check the ConfigureServices of Startup.cs) at least for starting it up.
Later on, if you decide to use your custom certificate, have in mind that the user, that is running the IDS application (by user I mean the application pool user) should have at least read privileges over the certificate (I guess that you've seen that in the article you have provided).
Do all these, and let's see what progress you will have, but most important - enable the logging.

Want to keep running the exchange migration code after closing the web browser

I have asp.net Mvc application in which I am migrating mails from one exchange server to another , now I want to keep running migration process and don't want to keep open browser means when user closes browser process must be running at the back and after opening the browser user can check the progress of migration.
Can anyone help me in this, how to achieve this task using asp.net Mvc 4 c# or using any other service
Given the low amount of information in your question, I can only answer concisely.
When the user triggers the migration (i.e. sends the request to MVC), you'll have to trigger the migration in a different thread.
Make sure that the different thread has access to a globally accessible variable, e.g. bool MigrationIsRunning. Your migration will set this to true when starting, and back to false when completed (by success, or by error. Either way).
When your user returns to the migration page, have your Controller method check the value of MigrationIsRunning (the variable from the previous step), and return the correct feedback to the user.
Note: instead of a bool, you could use a custom class that shows more detail. I'm not sure what your users need to know when the migration's running.
Note 2: If your entire application should be inaccessible during the migration, you're better off with placing step 3 either in your Masterpage, or Global.asax, so you have full coverage of your web application instead of a single page.

When are the parameters used in WebResource.axd reset?

When using WebResource.axd you will see two parameters being passed in the query string. Usually looks something like this:
WebResource.axd?d=9H3mkymBtDwEocEoKm-S4A2&t=634093400273197793
I have run into an issue where I need a permanent link to the resource in question. Recently the link I was using stopped working. What would cause these ids to change? Rebooting the server? Recompiling the code? Is there anyway to make these ids permanent?
Background -
As part of a site monitoring service we are subscribed to, we have "recorded" several sets of user actions for our website. For example, we recorded the process of logging into the site. The monitoring is now saying that the user login process fails (it's working fine) because it cannot find the WebResource.axd with the ids it recorded.
This page provides all the information on the makeup of the URL
http://support.microsoft.com/kb/910442
The "d" stands for the requested Web Resource
Something worth noting is that you don't need to have the timestamp (t) parameter there to call the resource. Try it on your own site, view the source and grab a webresource.axd url and navigate to the it, remove the t

Getting error Error: The given key was not present in the dictionary. in production

I am using ASP.Net 4.0 w/ a C# Web service. This also utilizes a C# library, which is working fine in development and with other applications (Skype bot and Windows form)
I am using JQuery to communicate via JSON to the web service. In development, this is working fine. In production, it is partly working. I can use some commands, but other commands simply throw this error:
Error: The given key was not present in the dictionary.
I am not certain where to begin with this. I can't step through code because it only happens in prod. I checked the IIS logs, and every request is getting a 200 status, so it appears it is something inside of the app itself. Any ideas where to start with this?
The error suggests that the server-side code is attempting to access a dictionary with a key that is not in that dictionary.
I suggest modifying the code to place error handling around all dictionary access. When handling the error, log the key that was attempted to be read from the dictionary.
When logging exception details, it is wise to log all available information.
Exception.ToString()
accomplishes just that.
You can delete all queue message from sqlsrver Queue you are using as ,
declare #c uniqueidentifier
while(1=1)
begin
select top 1 #c = conversation_handle from dbo.yourqueuenqme
if (##ROWCOUNT = 0)
break
end conversation #c with cleanup
end
It will work after that .
The issue was that I was using WebClient to call a URL that required a Login. I setup my app pool w/ my domain creds and then I was able to call the page w/o being prompted for a login.
Once calling the page, I was able to populate a list and loop through it. The error above was thrown because I was looping through an empty list.

Google-drive example: oauth2callback not found

I need a little help with the C# example program of Google-Drive...
I used this so-called "tutorial"/"example":
https://developers.google.com/drive/examples/dotnet
And the code from here:
https://code.google.com/p/google-drive-sdk-samples/source/checkout
I uploaded my (only slightly modified) sourcecode here in case anybody doesn't have Mercurial (I didn't have Mercurial and no admin rights to install it either, and Mercurial is the only way to get the sourcecode...):
http://verzend.be/elt0k13enraw/DrEdit.rar.html
I always get
"Ressource cannot be found"
Requested URL: /oauth2callback
I don't find this astonishing, as no oauth2callback controller or handler is implemented...
I tried adding a Controller called oauth2callbackController and redirecting to another action in oauth2callbackController.Index, doing
return new RedirectResult("/about/about");
But that only creates a NULL-reference exception.
So i figured, maybe the wrong controller and redirected to
return new RedirectResult("/drive/Index");
But that only creates an infinite loop of redirect -> allow -> redirect - allow -> etc.
BTW, the config to change the API key + REDIRECT_URI is in
Models\ClientCredentials.cs
Note:
The problem aren't my modifications.
The sample also didn't work unmodified, with the exact same error.
All I did was removing EntityFramwork references, and throwing "Not implemented exception" when a method using entity was called.
Edit:
Additional information:
What I really wanted to do in the first place is to write a console service that exports my database, LZMA-compresses the exported content, encrypts that with OpenPGP, and uploads the database of my server to Google drive every day at 24:00 o'clock, without any user input.
I got export working without a problem, i got the LZMA compression working without a problem, I got the encryption with PGP working without a problem.
After the end of the working day (grrrr), when I was at home, I was even able to download the example-code with the mercurial installed on my Linux-machine at home, and bring it on the windows machine using SMB...
But now I can't get the sample for the Google-drive SDK working...
And moreover, what I really need is an example for a console service/daemon, not a web-application.
When I created the API key, I saw one could create a key for a service, but there is no example on how to write a Google-Drive service (console application), and no useful documentation as well (yea there is a reference, but it's only a reference, IntelliSense provides about the same)...
When configuring your app in the API Access tab of the APIs Console, you had to set the root (/) of your web server as the redirect URI and not /oauth2callback.
Assuming that your app is published at www.example.com, just go back to the APIs Console and set it to www.example.com instead of www.example.com/oauth2callback

Categories

Resources