i have create a c# form application for parsing Html using Winista.html parser.
Now i have created a setup project for this and when i install the setup and run it generates error
System.IO.FileNotFoundException: Could not load file or assembly 'Winista.HtmlParser,
Version=1.8.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
system cannot find the file specified.
File name: 'Winista.HtmlParser, Version=1.8.0.0, Culture=neutral, PublicKeyToken=null'
at Investigator.Form1.googleNewsSearcher()
Why is this happening ? Why is it not finding the dll , i pasted the winistal.HTMLParser in the bin folder ,and add reference to it .Is there any thing missing please help this is very urgent , i have to submit this?
Thank you
YOu have to add a reference, when you create a setup project it doesn't look in the bin folder for assemblies it checks references. You should be able to add the assembly to the setup project. I would suggest that you add it as a reference though.
You might also need to re-add the primary project to the setup project once you do this, but I think a rebuild should solve it once you added the reference to the assembly.
Update
Try right clicking on the reference and select copy always. This will insure that the assembly is always coppied to the bin folder.
Related
I've created a Class Library in C# .Net Framework 4.8, and in the solution I've also included a Console Application, same target.
I'm running both in a x64 configuration.
No errors on build.
I referenced the App in the Library, and when I run a Button in a Form in the Class Library I'm getting an error:
System.IO.FileNotFoundException: Could not load file or assembly
'ExampleApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or
one of its dependencies. The system cannot find the file specified.
File name: 'ExampleApp, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null'
I've combed the internet and SO for a solution. I tried repairing Visual Studio, I tried deleting the .vs folder in the projects, I tried things like:
solution 1
and
solution 2
I seriously tried everything I could think of. It has to be something to do with the .dll dependencies imho, because the only one that my ExampleApp is using is the Microsoft.CognitiveServices.Speech reference which I installed via NugetPackage in my solution.
No idea how to debug this further or get a proper trace stack from this error...
Any ideas on how to proceed?
Thanks
Solved by changing the .dll's Copy Local property to True
Exactly #Yafim Simanovsky, I solved also my problem by changed <Private> flag to True.
My problem (“Could not load file or assembly…”) was with new Designer ‘WpfSurface.exe’ from VS 2022, which after changing the reference tags ‘Private’ to True, was able to copied all dependent .dll files to Cache.
My application is running fine on local, after i publish to azure web apps it gives me the error
Could not load file or assembly 'Microsoft.Practices.ObjectBuilder2, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
how do I fix this? I do not even have the objectBuilder2, if its something I have to reference where do I get it?Please help
Microsoft.Practices.ObjectBuilder2 is part of Enterprise Library. See here
Do you use this library? If not, try to remove references to it. If you use it, then add appropriate .dll to your installation.
For me Microsoft.Practices.Unity references was broken. I've just removed and added it again and worked. Maybe any refereces to Microsoft.Practices.* that would be broken can show this error.
Place Microsoft.Practices.ObjectBuilder2.dll in bin folder of your web application, this will work.
I've upgraded a VB6 project to C# and I'm trying to run a winforms project and I have the Interop.InetCtlsObjects.dll file in my project and I've added a reference to it, but when I'm trying to run it I'm getting this error:
Could not load file or assembly
'Interop.InetCtlsObjects, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
or one of its dependencies.
The system cannot find the file specified.
But I can see the file and I added a reference to it's exect location...
So what am I missing here ???
Delete the reference, save the project and add it in again. It is possible that you are somehow referencing a different version and the compiler cannot find the right DLL because of it. If that doesn't work, check your app.config and make sure the versions for this particular DLL match.
I downloaded an open source project written in C# and I can build that project. However, I got the error like this during run time:
Could not load file or assembly 'Interop.ComUtilitiesLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
This means it couldn't load the Interop.ComUtilitiesLib.dll file, I have checked in project root directory as well as in the Window/System32, still couldn't find the Interop.ComUtilitiesLib.dll file.
Any suggestion for me to fix this problem!
Does the project include a ComUtilities.dll file? If so, it might be a COM object that needs to be registered via the command line:
regsvr32 ComUtilities.dll
I'm trying to reference Oracle.DataAccess.dll in my c# project assembly. When running the project I get the following error:
Could not load file or assembly 'Oracle.DataAccess, Version=2.112.2.50, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I'm really confused because when I right click references and add an assembly I navigate to a copy of the dll that I have in a folder contained within the project and add the reference. When I look at the properties of the reference, though, it shows a path of
C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\Profile\Client\Oracle.DataAccess.dll
and sure enough there is a dll in there by that name, but it's an old version. Why does this reference not point to the path that I specified when adding it, and how can I get it to use the dll at the location that I specified?
We take a couple of steps to resolve issues like this when we know that the specific version does not matter to the built application:
1) In the properties for the reference within the project, ensure the Specific Version property is set to False.
2) Save the project, the edit it in notepad or the text editor of your choice. Find the DLL reference and remove all version and key information and ensure the hint path points to your copy of the file. For example:
<Reference Include="Oracle.DataAccess">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Assemblies\Oracle.DataAccess.dll</HintPath>
</Reference>
Visual Studio can be a bit flaky when it comes to references. Many times we have to just edit the project file directly. Setting the properties of the reference directly doesn't always stick. Right-click your project, select Edit Project File, and make the change there. It should stick.