EDN Admin
Well-known member
So if i send my program to someone else he will get the error.
This is the full directory where the file is now: D:C-SharpDownload FileDownloading-File-Project-Version-012Downloading FilebinDebug
I was sure that if i added the dll to the reference it will stay embedded in the program project for ever. But it must be also in this specific directory.
How can i embedded the dll file in the project so even if its not in the directory it will not say that he cant find the file.
This happen after the program is loaded run good but then im clicking button 1 that should start downloading...and then im getting this exception:
FileNotfoundException:
Could not load file or assembly unfreez_wrapper, Version=1.0.4289.2723, Culture=neutral, PublicKeyToken=null or one of its dependencies. The system cannot find the file specified.
System.IO.FileNotFoundException was unhandled<br/>
Message=Could not load file or assembly unfreez_wrapper, Version=1.0.4289.2723, Culture=neutral, PublicKeyToken=null or one of its dependencies. The system cannot find the file specified.<br/>
Source=My Weather Station<br/>
FileName=unfreez_wrapper, Version=1.0.4289.2723, Culture=neutral, PublicKeyToken=null<br/>
FusionLog==== Pre-bind state information ===<br/>
LOG: User = Chocolade-PCChocolade<br/>
LOG: DisplayName = unfreez_wrapper, Version=1.0.4289.2723, Culture=neutral, PublicKeyToken=null<br/>
(Fully-specified)<br/>
LOG: Appbase = file:///D:/C-Sharp/Download file:///D:/C-Sharp/Download File/Downloading-File-Project-Version-012/Downloading File/bin/Debug/<br/>
LOG: Initial PrivatePath = NULL<br/>
Calling assembly : My Weather Station, Version=1.0.0.5, Culture=neutral, PublicKeyToken=null.<br/>
===<br/>
LOG: This bind starts in default load context.<br/>
LOG: Using application configuration file: D:C-SharpDownload FileDownloading-File-Project-Version-012Downloading FilebinDebugMy Weather Station.vshost.exe.Config<br/>
LOG: Using host configuration file: <br/>
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFrameworkv4.0.30319configmachine.config.<br/>
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).<br/>
LOG: The same bind was seen before, and was failed with hr = 0x80070002.
StackTrace:<br/>
at mws.Picturebox2_Fullscreen..ctor()<br/>
at mws.Form1.button1_Click(Object sender, EventArgs e) in D:C-SharpDownload FileDownloading-File-Project-Version-012Downloading FileForm1.cs:line 694<br/>
at System.Windows.Forms.Control.OnClick(EventArgs e)<br/>
at System.Windows.Forms.Button.OnClick(EventArgs e)<br/>
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)<br/>
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)<br/>
at System.Windows.Forms.Control.WndProc(Message& m)<br/>
at System.Windows.Forms.ButtonBase.WndProc(Message& m)<br/>
at System.Windows.Forms.Button.WndProc(Message& m)<br/>
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)<br/>
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)<br/>
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)<br/>
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)<br/>
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)<br/>
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)<br/>
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)<br/>
at System.Windows.Forms.Application.Run(Form mainForm)<br/>
at mws.Program.Main() in D:C-SharpDownload FileDownloading-File-Project-Version-012Downloading FileProgram.cs:line 25<br/>
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)<br/>
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)<br/>
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()<br/>
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)<br/>
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)<br/>
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)<br/>
at System.Threading.ThreadHelper.ThreadStart()<br/>
InnerException:
So how can i make sure that the file is embedded ?
Thanks.
<hr class="sig danieli
View the full article
This is the full directory where the file is now: D:C-SharpDownload FileDownloading-File-Project-Version-012Downloading FilebinDebug
I was sure that if i added the dll to the reference it will stay embedded in the program project for ever. But it must be also in this specific directory.
How can i embedded the dll file in the project so even if its not in the directory it will not say that he cant find the file.
This happen after the program is loaded run good but then im clicking button 1 that should start downloading...and then im getting this exception:
FileNotfoundException:
Could not load file or assembly unfreez_wrapper, Version=1.0.4289.2723, Culture=neutral, PublicKeyToken=null or one of its dependencies. The system cannot find the file specified.
System.IO.FileNotFoundException was unhandled<br/>
Message=Could not load file or assembly unfreez_wrapper, Version=1.0.4289.2723, Culture=neutral, PublicKeyToken=null or one of its dependencies. The system cannot find the file specified.<br/>
Source=My Weather Station<br/>
FileName=unfreez_wrapper, Version=1.0.4289.2723, Culture=neutral, PublicKeyToken=null<br/>
FusionLog==== Pre-bind state information ===<br/>
LOG: User = Chocolade-PCChocolade<br/>
LOG: DisplayName = unfreez_wrapper, Version=1.0.4289.2723, Culture=neutral, PublicKeyToken=null<br/>
(Fully-specified)<br/>
LOG: Appbase = file:///D:/C-Sharp/Download file:///D:/C-Sharp/Download File/Downloading-File-Project-Version-012/Downloading File/bin/Debug/<br/>
LOG: Initial PrivatePath = NULL<br/>
Calling assembly : My Weather Station, Version=1.0.0.5, Culture=neutral, PublicKeyToken=null.<br/>
===<br/>
LOG: This bind starts in default load context.<br/>
LOG: Using application configuration file: D:C-SharpDownload FileDownloading-File-Project-Version-012Downloading FilebinDebugMy Weather Station.vshost.exe.Config<br/>
LOG: Using host configuration file: <br/>
LOG: Using machine configuration file from C:WindowsMicrosoft.NETFrameworkv4.0.30319configmachine.config.<br/>
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).<br/>
LOG: The same bind was seen before, and was failed with hr = 0x80070002.
StackTrace:<br/>
at mws.Picturebox2_Fullscreen..ctor()<br/>
at mws.Form1.button1_Click(Object sender, EventArgs e) in D:C-SharpDownload FileDownloading-File-Project-Version-012Downloading FileForm1.cs:line 694<br/>
at System.Windows.Forms.Control.OnClick(EventArgs e)<br/>
at System.Windows.Forms.Button.OnClick(EventArgs e)<br/>
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)<br/>
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)<br/>
at System.Windows.Forms.Control.WndProc(Message& m)<br/>
at System.Windows.Forms.ButtonBase.WndProc(Message& m)<br/>
at System.Windows.Forms.Button.WndProc(Message& m)<br/>
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)<br/>
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)<br/>
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)<br/>
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)<br/>
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)<br/>
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)<br/>
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)<br/>
at System.Windows.Forms.Application.Run(Form mainForm)<br/>
at mws.Program.Main() in D:C-SharpDownload FileDownloading-File-Project-Version-012Downloading FileProgram.cs:line 25<br/>
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)<br/>
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)<br/>
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()<br/>
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)<br/>
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)<br/>
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)<br/>
at System.Threading.ThreadHelper.ThreadStart()<br/>
InnerException:
So how can i make sure that the file is embedded ?
Thanks.
<hr class="sig danieli
View the full article