I have created a user control (uctxt) and an application to test that user control. Suppose the application lies in folder D:\snt\TestOcx on my local machine. And its exe will be created in D:\snt\TestOcx\TestOcx\bin\debug\TestOcx.exe and the dll of the usercontrol (uctxt.dll) to be tested will also be lying in the same above mentioned folder. Now I am putting this TestOcx.exe and uctxt.dll in the wwwroot folder of the server. But when I try to run this exe from server, a FileNotFoundException is generated indicating that the uctxt.dll file is not found. So where should I locate this dll?

Dani AI

Generated

The error usually comes down to deployment context: whether uctxt is an ASP.NET/website control or a desktop (WinForms) control used by TestOcx.exe. Both placement and the process identity matter.

If uctxt is being used by a web application (an ASP.NET control or compiled control library), the CLR expects the assembly in the web application's bin folder (or the GAC for shared, strong‑named assemblies). Placing an EXE and a DLL in wwwroot and trying to run the EXE from IIS is not a normal web deployment pattern and often fails because of permission, execution policy, or app‑base/probing differences.

If TestOcx.exe is a desktop test program that depends on uctxt.dll, the dependent assembly must be reachable by the runtime at execution time—typically in the same folder as the EXE or installed into the GAC (which requires a strong name). Running that EXE from a web server can introduce problems: the process may run under a different account, the working directory may not be what the EXE expects, and IIS may block execution. was correct to flag placement and permissions; those are common causes.

Troubleshooting checklist and next steps (diagnostic, not exhaustive):

  • Confirm whether the control is for web or desktop and deploy to the appropriate location (bin for web apps; same folder or GAC for desktop apps).
  • Check file system permissions and process identity on the server.
  • Check .NET version and platform target (x86/x64) compatibility.
  • Use the Assembly Binding Log Viewer to capture binding failures and see what path the loader tried. See How the runtime locates assemblies and Fuslogvw.exe (Assembly Binding Log Viewer).
  • If distributing a desktop app via HTTP, consider publishing (ClickOnce) or an installer as suggested: .

A short, safe fix in most cases: put uctxt.dll into the same folder where the EXE actually runs (or into the web app's bin if it's a server control), then capture binding logs if the problem persists.

Recommended Answers

All 2 Replies

The .exe and .dll should be beside each other, you may don't have the permission to run the application.

Dear ShreyaTrivedi,

I don't understand what you want to do exactely, but if you want to make Click Once Deployment, you should publish your project to this server.

to know how to publish this file use this link this will help you
http://msdn.microsoft.com/en-us/library/748fh114(VS.80).aspx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.