Assembly hell - FileNotFoundException was unhandled

115 views
Skip to first unread message

coding...@gmail.com

unread,
Sep 3, 2015, 6:20:24 AM9/3/15
to topshelf-discuss
My topshelf webapi project is working fine after I click F5 in Visual Studio 2013 Community Edition running on my LOCAL Windows 8 laptop. 

I conduct various tests by sending it an HTTP REQUESTs from POSTMAN. I get RESPONSEs just fine.

 My problem occurs when I take the following steps. 

I copy the executable in my \bin dir to c:\temp. 
From an ms-dos command promt (cursor at c:\temp=>=>=>) I run the following command;

MyExecutable.exe install

I get the following error: 
System.IO.FileNotFoundException was unhandled
Message: An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Unknown Module.

Additional information: Could not load file or assembly 'Microsoft.Practices.Unity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 
or one of its dependencies. The system cannot find the file specified.

Please note. When I run the above dos command from the \bin directory, the exe DOES install itself as a Windows service SUCCESSFULLY into my laptop(I verify by going into Windows Services and it exists there). So, my point is that, I intend to deploy this in a typicall promotion, as to production from dev env. I assume it will produce the same error above; when I attemp to DEPLOY this to prod Windows server. 

Dru Sellers

unread,
Sep 3, 2015, 10:54:05 AM9/3/15
to topshelf...@googlegroups.com
so, my first question is what is your Copy command look like?
Is the Unity dll in the C:\temp dir?

-d

--
You received this message because you are subscribed to the Google Groups "topshelf-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topshelf-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

coding...@gmail.com

unread,
Sep 3, 2015, 9:56:07 PM9/3/15
to topshelf-discuss
Hi Dru,

======
| my first question is what is your Copy command look like? c:\Users\UserOne\Documents\SolutionBeta\bin\Debug> Copy myexe.exe c:\Temp
| Is the Unity dll in the C:\temp dir? NO
======

I surmise what you are indicating is that (.exe.config file) & all the assemblies my executable depends upon Should Also be located(copied) in/to c:\Temp

Chris Patterson

unread,
Sep 3, 2015, 10:14:31 PM9/3/15
to topshelf...@googlegroups.com
That's how the .NET assembly binder works. Current directory, and then based on the binding rules. That's not something we control, that's how .NET works.

Dru Sellers

unread,
Sep 4, 2015, 9:07:37 AM9/4/15
to topshelf...@googlegroups.com
Yup, you got it. You have to copy the entire bin dir. :)

-d
Reply all
Reply to author
Forward
0 new messages