The remote procedure call failed and did not execute. (Exception from HRESULT: 0x800706BF) - com

I did ask this question at Microsoft forums but did not get any reply. I am asking here hoping to get an answer. My query is detailed below.
I have a C# application which manages user's on AD using ADSI APIs. For managing user's password, I make use of IADsUser.SetPassword(string NewPassword) of Interop.ActiveDs.dll.
The issue I am facing is only when domain controller is installed on Windows 2008 enterprise SP2 OS. It is not reproducible on Windows 2008 R2.
When I try setting the password one user by one, there is no issue at all. But if I create threads for each user and then each thread calls this API I get "The remote procedure call failed and did not execute. (Exception from HRESULT: 0x800706BF)" .
Apart from this, I do not see anything on the event viewer on the DC or anywhere. This something similar to what is mentioned here http://support.microsoft.com/kb/960007 which is for 2003, has someone seen this issue on 2008 enterprise SP2 ? Is this a known issue ?
I am installing all the updates which are pending using windows updates, hopefully it might resolve. Can someone please answer if they have seen this issue and what were the steps taken? Thanks.

I ran into something similar running an ASP.NET web application in VS 2015, AND I also had a LightSwitch application running in VS 2012 under different credentials. Rebooting did not do the trick. Enabling native code debugging did:
Debugging unmanaged code while debugging managed code
I did not do anything except turn it on. My app ran fine after that. I went ahead and turned it off and it still ran fine. Whatever works.

Related

MysqlDataAdapter.Update not throwing exception

In my application I have drag and drop functionality for a TreeView and for a DataGridView.
It works great and I have no issues with the code.
I use Visual Basic - Visual Studio 2017 Community on Windows 10 Home Single Language 64-bit. After Building Release it also works fine on Windows 10 when running release.
I then copy it to a Windows 2008 R2 Virtual server where it is run by each user through Remote Desktop.
The strange issue I have is that the TreeView drag and drop functionality works 100%, but the DataGridView seems to ignore my drop - only on the Server.
I can't find anything on the net that relate to this.
Any ideas how I can troubleshoot this issue?
======================================================================
After tediously adding messages between lines I came to the conclusion that it is the MySqlDataAdapter.Update() line that is not executing.
No exception, just stops at this line and throws me out of the DataGridView.DragDrop Sub.
So the new question is, how do I catch that error after compile?
I think I probably asked the question too quickly, apologies.
For anyone that does not get an exception from MySqlDataAdapter, check permission on triggers.
In this case on my development computer root user can access from %.
On the server root is configured for access from localhost only.
One of the triggers was defined "CREATE DEFINER=root#% TRIGGER..." and after changing it to root#localhost it worked.

Application pool account permission to run RestSharp

Recently my web server (windows server 2012 R2) got several Windows updates. Since then I am not able to run a code involving RestSharp. It fails whenever I try to initialize "new RestRequest()". Windows event log registers this error: "User does not have permission to run the resource"
I have development environment with Windows 7 where I don't see these updates. My code runs fine.
I have looked into the update history on the server and looks like the following updates may be creating these problems.
KB3074548
KB3074228
KB3074545
I have looked into documentation of RestSharp to find out whether any specific permission needed on the application pool running RestSharp code. I could not find out anything.
I am wondering whether anyone else having this problem and/or may have any knowledge about permissions required to run RestSharp request.
Really appreciate any help.
It is now working. It was just a deployment issue.

windows service works on XP but fails with error 1053 on w2k3 64 bit

Forgive me if this is a stupid question, I'm fairly new to writing services. I've written a service that runs a timer and the timer code runs some checks to ensure our systems are up and running. It's written in VB.Net, framework 1.1. I then install the service using "sc create". The service works beautifully on the XP Pro machine that I'm developing on. However, when I install the service on a Windows 2003 server 64 bit, the service fails with error 1053 immediately. I put some debugging in to write to a text file as the first line of code in the OnStart function but even that doesn't run, so there must be a problem in the program starting up. Finally in desperation I created a brand new Windows Service in a new VB project in Visual Studio 2003 and compiled an empty service that merely declares and sets the value of a string variable in the OnStart function as follows:
Dim strTmp As String
strTmp = "hello"
Even that failed on the W2K3 server, but works fine on the XP dev machine.
The server has .Net Framework 1.1 installed and working, we use it in our CMS (written in ASP.Net 1.1).
The service runs as the local system account. I tried enabling interaction with the desktop but that didn't help. I ran Process Monitor and there are no access denied events. I emptied the Application Event Log, still doesn't work. No other events to help me out in the logs. Definitely using the Release build of the application. Permissions on the exe file are full control for System and for Admins.
Any ideas anyone? It must be something simple, but I'm damned if I can figure it out!
Thanks in advance.
#DavidHi, many thanks for the suggestions. I donĀ“t think the first point is my problem, partly because the MS article is about stopping or pausing the service, mine fails on starting; but also because the service does not timeout, there is no 30 second wait, it fails immediately. Secondly, when you say add an exception handler to the service startup, do you mean the OnStart sub? I tried adding a debug file write in there, but I'll try adding an event log instead. Regarding the systems checks, it can't be that because the brand new empty test service I created shows the same behaviour and that does not do anything at all. You last point could be the key. My dev environment IS 32bit. I'll do some research on the corflags thing, or perhaps I can build a 64bit dev environment. Many thanks again, you've given me some new things to think about at least!
Ok, have found a workaround. I was putting my exe file in System32. When I put it in a different folder, created by myself, the service ran, albeit briefly. I then had to move the ini file and the log files that it reads/writes to that folder too, rather than System32, and all seems to work nicely. God knows why it doesn't like running from System32 but at least it works now! Thanks for the help guys.
This looks very similar to this question which might help you out:
Starting a windows service fails with error 1053
A couple of other things to look out for:
Make sure you don't have either of the following statements in your deployed service:
System.Diagnostics.Debugger.Launch
System.Diagnostics.Debugger.Break
You may need to run the service with an account other than Local System (depending upon the permissions required by your service).
The 1053 error is a timeout related to the service control manager waiting for the service to respond to your start request. There is a knowledgebase article that refers to managed service stop request issues specifically relating to Framework 1.1-based services, so it is not precisely describing your problem, but it may have relevance in your situation. The link is provided for your reference.
http://support.microsoft.com/kb/839174
The other suggestion I would make to further diagnose the issue is to determine whether the Start is failing due to a "hidden" exception occurring in your service's startup code; the start call would not see the exception and could make you think it was merely timing out.
I would suggest you add an exception handler to your service startup that does nothing more than log a message to the event log with the particulars of the exception if one is caught. That would at least give you an idea that something is going wrong specifically within the service, and give you more information than you have right now.
One last thought: Does the service check the systems you describe over a network connection? If so, LocalSystem won't have sufficient privileges to perform network access.
Good luck!
EDIT One other possibility:
Is your development environment/execuable 32-bit? You mention your server is 64-bit, so you may need to use the "corflags" tool that forces 32bit operation on your executable
corflags /32bit+ YourServiceExectubable.exe
The source for this information was the following SO post:
32-bit Windows services in 64-bit environment
**Unfortunately, it appears corflags is applicable only for 2.0 assemblies, and was designed for specifically this type of problem. **

Silverlight Application gives 4004 error when trying to use RIA services

I have written a Silverlight application that is basically an account registration form. I have been able to successfully deploy this to one of our production servers running windows server 2008/IIS7. While this took some time to do, I was able to work through and solve the issues that came up fairly easily. Now I am trying to deploy the application on our main production server. This server is running windows 2003/IIS6 and this is where I have hit some problems.
I have solved most of the issues and now the silverlight application will load and I can see the form for a few seconds before it disappears. I believe during this time it is trying to load data from the database using the RIA services.
In IE I get the following error:
Webpage error details
Message: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.Windows.Markup.XamlParseException:
System.Windows.Markup.XamlParseException:
System.Windows.Markup.XamlParseException:
Cannot find a Resource with the Name/Key ApplicationResources [Line: 6 Position: 9]
I believe it must be a configuration issue in IIS6 because the app works fine on IIS7 but I am drawing a blank as to what to try. I have spent hours trying to find a solution to this particular problem and while others have mentioned getting this problem the answers always tend to be non-specific in nature.
This is what I have done so far:
Added New Application Pool for .NET 4.
Set the website to use .NET 4 on the ASP.NET tab (nearly had heart failure when this did an iisreset).
Added the MIME types for Silverlight .xaml, .xap, etc.
Unchecked Integrated Windows Authentication (was giving an error when checked).
Give Execute permissions to Scripts and Executables.
Recycled the application pool.
The one thing I have seen suggested but have not tried is an iisreset, and while I am not entirely convinced that doing this would solve the problem, we have scheduled this to be done tonight (if I cannot find a solution before then).
So basically I am wondering if anyone out there has seen this problem and knows how to solve it?
UPDATE 1: We tried an iisreset last night and as I expected this did not solve the problem.
Okay I have solved the problem. As suggested I did a WCF trace on the application. This highlighted the REAL problem straight away, which was 'The SELECT permission was denied on the object...'. Once I fixed this the application works as I expected. It turns out that a colleague of mine had already made this permission change on our other server (running IIS7) so that was why it worked there (this is bad - I know).
Also it didn't help that the javascript error I was receiving on the client side (shown in the question) had nothing to do with the underlying issue and led me well and truly up the garden path.

setup project vs2010

every time i do build to setup project on vs2010 its starts sql manager 2008 process for a while and build. the process takes couple of minutes.
in 2008 it did not do that
any thoughts why ?
G
I don't have an "answer." But I have some information. This (or a very similar) question was asked in how do I stop sql server 2008.... In my case, I had installed VS 2010 (Ultimate) from a Passport drive; SQL 2008 was installed from an ISO image. If I simply plug in the passport drive (VS2010 source) when building the Setup project, the issue "goes away" in the sense that it does not show the dialog. My hunch is that it is still doing the same work, but is finding what it wants (quickly) on the passport drive. If I disconnect the external drive, the problem returns. So if the message is correct and VS 2010 is trying to configure something, it never really gets configured; but it gets past it quickly if it can find its install source.
Someone who has spent more time working with all the configuration pieces might be able to do more with this information.