I'm porting a Service administrator application written in C++ 6 to .Net C#.
This application install, uninstall, start, stop ... services written in .NET C#.
Everything is ok when installing a service.
My problem is on trying to start a service from my application or from the OS service agent, I get a error saying "Acces is denied".
When I use my old C++ 6 application I can install and start the same service without any problem.
Am I missing any security settings or have you any idea ?
Following a piece of the code I'm using:
I know this question has been asked many times and althought I have browsed through several message boards, I can see the question but not the answers.
Because of that, I tried to figure out which method or methods the datagrid has to paint the column headers. Using reflection I found out that there are two methods: PaintColumnHeaders and PaintColumnHeaderText.
However, this methods are private and can't be overridden or hidden.
I can't understand why they made these methods private but anyway, does anyone know how to go around this?
also, there is a private method that returns the header rectangle. I was able using the MethodInfo.Invoke method to get this object but I can't do anything with it.
I am just learning to use the Reflection namespace I haven't figured out how to deal with this, any ideas?
Can someone direct me to step by step directions on how-to setup my computer (.Net 2002. W2K)so I can begin playing with web applications. I have IIS installed & running along with all the .NET options from the setup. I create a simple asp.net application. I add just a label. When I try to run it (f5) it complains about the debugger. If I start without debugging, I just get unformatted text. I must have the setup messed up.
I am getting this exception from time to time when trying to connect to authorize.net. I can fix the problem by re-cycling the application pool (i.e. re-start IIS) but it only stays fixed for a couple days then it starts happening again. Here is the exact error.
Exception Details: System.EntryPointNotFoundException: Unable to find an entry point named EnumerateSecurityPackagesW in DLL security.dll.
I originally got this error on this serverr when I added this script to the website. I fixed it by adding the "ASPNET" user group to the file permissions for this page and set it to modify control. That got me going but only for a couple days and then it stops. It will process cards just fine when it is not throwing this error.
Very very odd. I cannot believe it is code related because of the sporadic nature and I use this EXACT SAME SCRIPT on another server and it works with zero problems.
By the way, I do not have a custom DLL named security.DLL that would be causing a conflict or any other custom DLL for that matter. I am completely stumped.
When using P/Invokes, the Framework simply uses the Windows LoadLibraryEx function to load the library. You're therefore constrained by the DLL search order used by LoadLibrary.
I'm not sure exactly whether or when the Framework calls FreeLibrary. From my experience, I don't think it does, except possibly when unloading an AppDomain.
At a guess, I'd say your live server is running Windows 2000 and has a security.dll somewhere on the system - possibly in another virtual directory. When your application starts up, the ASPNET_WP worker process creates an AppDomain for your application. If somehow the current directory for the process is a directory which contains a security.dll, that will get loaded rather than the system's version, because the current directory appears before the system directory on Windows 2000. This problem will also occur on Windows XP before SP1. The default for XP SP1 and Windows Server 2003 is for the system directory to be searched before the current directory, but this can be altered by setting HKLM\System\CurrentControlSet\Control\Session Manager\SafeDllSearchMode to 0.
I think you could kludge this by P/Invoking the LoadLibrary function to explicitly load security.dll from the Windows directory. If you pass a path to LoadLibrary, that version will be loaded. Subsequently, any use of LoadLibrary without supplying the path information (as P/Invoke does) will use the version that's already loaded.
If you're going to do this - and I make no guarantees it will work - it probably needs to go in global.asax in an override of HttpApplication.Init.
Good Heavens Mike we may have hit the Mother Load.
It is Server 2003 but you really jarred something in me when you said "Security.DLL" somewhere on the system - not necessarily in the web directory. As a result, I did a search of the entire web server and guess what I found? A file named security.dll in one of the other websites on there. It was from a long time ago and was for a web service I was screwing around with like a year ago. Think that could cause it to happen?
I do not know if that will do the trick but I now know the only thing(s) on here named security.DLL are system DLLs. BUT I still have three.
One named "System.Security.DLL" which is in "Microsoft.NET \Framework\v1.1.4322"
One Named "Security.DLL" in the "System32" folder
Another Named "Security.DLL" in "Microsoft.NET \Framework\v1.1.4322\Temporay ASP.NET Files\root\"
Yep, that third one probably did it. I've thought of another way it could happen: if the other security.dll is a managed DLL.
The CLR still uses the LoadLibrary API to load managed DLLs, for compatibility with Managed C++ (in which it's possible to implement DLLs with so-called 'flat' exports) I think. This loads the DLL with an explicit path. If this gets loaded before the P/Invoke (embedded in the depths of System.DLL) happens, LoadLibrary will return a handle to this managed DLL rather than looking for the DLL in System32, even on Windows Server 2003. This could happen if another website in the same application pool which uses that DLL starts before your application does.
My solution of using LoadLibrary explicitly likely wouldn't help in that case.
If you can delete that extra security.dll, that's the easiest solution. I suspect it's being copied back there by a different web application, though. Check the bin directory under your application roots.
If you ever have to deal with a situation where another web application is using a security.dll (or any other name which conflicts with a system DLL), your best bet is probably to create a separate application pool for one of the conflicting applications. This will force it to get a different W3WP worker process (in IIS 6.0), so they won't conflict.
What third one did the trick? Are you saying I should leave the security.dll alone that is located
is system32 and delete the other 2? One is in System32 and the other 2 are in "Framework" someplace.
Which should I delete?
I have looked in all the bins on the site and I got the security.DLLs out of there. While they
were not located directly in this application, I hope that was causing the problem.
I have a small program that runs the MSDE installer, then attaches a database etc. Now MSDE installs MDAC, but the program imports System.Data.SqlClient, which requires MDAC, and works nearly on every target machine.
Am I correct in guessing that the runtime only loads the MDAC stuff when it is first required, so the first function call to install MSDE doesn't use any data access, and by the time the second runs, the data access dll's are already present.
i dont think the article helped me much.
let me put this again:
need to know how to open word and power point sdocuments directly in the browser?
u see i have some pdf, word and powerpoint documents.they are placed in some location on my hard drive.
i have the paths of all thesein my SQL database.
now these paths appear in a data grid like hyper links its something like this:
doc1.ppt (power point file)
doc2.pdf (adobe file)
doc3.doc. ( word file)
so as soon as i click on a hyperlink, the selected document should open up in the browser directly.
the pdf files open directly the word and power point docs do not open.
Please note that i am developing an ASP.net (with VB.net) application
now how do i do this?
Hi there, Seemeen. I took from your original question that you wanted to write a .NET application that would open/manipulate word & powerpoint documents. It sounds like you want - from a user's point of view - to click a link and have the document open directly in the browser, rather than in a seperate instance of the application. Is this correct?
If that is the case, you are dealing with a client-side issue then, not a server-side issue. It's up to the client machine to determine how a document will open. I believe IE by default will open Microsoft Office documents inline rather than in a seperate instance window - so there may be a setting configured on your client machine that is forcing the documents to open seperately. Here are some links to relevant KB articles:
How can you install the DOT net framework completly silently? I use the /Q in the command line of dotnetfx.exe, but it prompts me for the lisence agreement. Is there a way to install it completly silently? I need to do an administrative install on many computers, and it is not possible to click ok for each one.
I have an application, that is built using 1.0.1515.12345 of a component in the GAC. I have auxillary programs(dlls) that also depend on the exact same version. I was hoping there was some way to examine the compiled dll (that doesn't load), to find out which version of the GAC based component it is depending on. All I seem to be able to glean at this point is that it won't load.
I'm hoping to be a little more helpful to the developers of these Dll's.
If I can't then i guess that's life.
I found this article on here on Codeproject.Undocumented Fusion[^]
Last Visit: 31-Dec-99 18:00 Last Update: 19-May-22 9:52