Could not load file or assembly 'log4net, Version=1.2.10.0 - vb.net

I did an application in VS2015 and Crystal Report, I can run it in the development machine (32bits) with no problem, I can load the forms where is CrystalReportViewer and print, all works fine but when I install it in another PC (32bits) and I try to load the form that have the CrystalReportViewer I get: "System.IO.FileLoadException: Could not load file or assembly 'log4net, Version=1.2.10.0 , Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies"
This is all I did:
I confirmed that log4net.dll exist in my debug folder
I saw the version (1.2.13.0) and change it for 1.2.10.0
I tested with a lot of configurations in app.config
I tried this official wiki:
https://wiki.scn.sap.com/wiki/display/BOBJ/Using+Crystal+Reports+for+Visual+Studio+2010+Merge+Modules+(MSM)+to+create+a+Setup+project
(I canĀ“t find any CRRuntime_13_x.msm file)
But the error still showing up
Please can you help me?

I found a quick solution installing CRRuntime_32bit_13_0_16.msi in the new PC, it is not a good solution and I must say that from now I prefer to do the reports with VB Net entirely.

Related

nHibernate not creating Oracle driver in MSTests run on command line

I've been working on this particular issue for a couple weeks now, and I'm exceedingly frustrated. As such, I'll give all the information I can and hope for the best.
My team is working on building a new application. Here's the alphabet soup:
.Net 4.5.1
nHibernate 4.0.0.4000 with FluentNHibernate 2.0.3.0
Oracle 11g (Oracle.DataAccess 2.112.1.0, which has Copy Local set to true)
Visual Studio 2013 is the IDE
Windows 7 Professional
I am compiling the application as a 32-bit app, and I have confirmed that I have the 32bit version of Oracle installed.
We've written some tests for the NHibernate mappings, which we run through MSTest. When we run these through Visual Studio's test explorer, they all run properly and pass. The application itself also properly compiles and deploys as it should. We've verified the tests are running properly by checking the database between steps, so we're fairly sure that the tests themselves aren't the problem.
When we run MSTest through the command line though, we receive the following error:
Initialization method MyTests.Setup threw exception. NHibernate.HibernateException: NHibernate.HibernateException: Could not create the driver from NHibernate.Driver.OracleDataClientDriver. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed..
I've tried reinstalling Oracle to no effect. I've tried checking the machine.config file for errors (as suggested in other posts here on SO) and found none.
Our Fluent configuration is as follows:
OracleDataClientConfiguration.Oracle10
.ConnectionString(connectionString)
.Driver("NHibernate.Driver.OracleDataClientDriver")
.ShowSql()
.FormatSql();
The code I'm running on the command line is the following:
(cd to the directory where the test .dll is)
>"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\MSTest.exe" /testcontainer:MyTests.dll /test:UnitTests
I feel like I'm missing something here. Any ideas?
Update: Solution Found
So here's a weird one. I followed Fran's solution below and installed the Oracle.ManagedDataAccess package and changed the NHibernate driver in our configuration above to NHibernate.Driver.OracleManagedDataClientDriver. As per our quick comment-discussion, this lead to a new error:
Initialization method MyTests.Setup threw exception. NHibernate.HibernateException: NHibernate.HibernateException: Could not create the driver from NHibernate.Driver.OracleManagedDataClientDriver. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Configuration.ConfigurationErrorsException: Failed to find or load the registered .Net Framework Data Provider
Fran then lead me to another SO question which encouraged me to check the Oracle configuration piece by piece. What better way to do this than create a test?
var x = new OracleConnection(connectionString);
x.Open();
Assert.IsTrue(x.State == System.Data.ConnectionState.Open);
x.Close();
Assert.IsFalse(x.State == System.Data.ConnectionState.Open);
In my quick attempt to run this test, I ran the whole collection of UnitTests with the script I'd mentioned above. Low and behold, every test passes!
Doing my due diligence, try the following
I comment out that test, clean, rebuild, and run the script again. Failures.
I return to the old Oracle driver and add that new test in. Clean, Rebuild, Run. Failures.
Add back the new Oracle driver, make sure the new test is still in. Run tests OTHER than the new test. Passes.
For some reason, the combination of the new driver and explicitly referencing it in a test seems to have resolved the issue. I'm open for any theories as to why, but I bet that qualifies as a new question.
I would stop using the bit specific version of the oracle drivers and move to the managed driver (https://www.nuget.org/packages/Oracle.ManagedDataAccess/). It is bit agnostic, and doesn't require you to install the Oracle client at all.
I actually found the solution to the problem, and it all has to do with how the Oracle.DataAccess.dll file gets loaded at runtime (Disclosure: I work with wadeb on the same project).
It seems that Oracle.DataAccess.dll was being searched for in every location on the server except the build output folder in the Jenkins workspace, and as such was pulling the DLL file from the GAC.
One of the file paths used to find the DLL file is the folder in which the "current executable" is located. In our case, the "current executable" was mstest.exe. Copying the Oracle.DataAccess.dll file to C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE did the trick.
Did it work. Yes.
Was it a hack? Absolutely -- but now it works without having to upgrade to the managed Oracle drivers.
Our servers weren't using an Oracle client that worked with the managed driver, and it wasn't acceptable to have a broken continuous integration build until servers get upgraded.
I have got just the same error and I switched my tests to x64 and it works like a charm now:

Could not load file or assembly 'microsoft.visualstudio.shell.ui.internal' or one of its dependencies. SQL Server 2012

My SQL Server 2012 suddenly stopped working here is all I got in popup message:
could not load file or assembly 'microsoft.visualstudio.shell.ui.internal' or one of its dependencies. An attempt was made to load a program with incorrect format.
I have Repaired using installation CD but no luck.
I had the same problem and fixed by uninstalling the Visual Studio 2010 Shell and installing back. Simply reinstalling doesn't work.
1. Download the Visual Studio 2010 Shell: https://www.microsoft.com/en-us/download/details.aspx?id=1366
2. Run the exe file and click uninstall(or remove).
3. Run the exe file and click install with default settings.
After these steps the Management Studio will work just fine.
I got this error in VS2013 when reparing in the logfille,
[113C:2588][2018-01-20T16:41:54]i000: MUX: ExecuteError: Package (vs_minshellcore) failed: Error Message Id: 1305 ErrorMessage: Error reading from file C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualStudio.Shell.UI.Internal\v4.0_12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Shell.UI.Internal.dll. Verify that the file exists and that you can access it.
and I check the file is exist, and I modify its access authority to complete control to every user account, but this error still occur,
Finally I delete this dll, and find same dll in another Normal Computer with VS , and copy the file paste to the problem computer, and run repair again then pass.
Share my works Microsoft.VisualStudio.Shell.UI.Internal.dll in Here.
But in my case after repair success, vs2013 still got error when opening, so I finally give up and turn to use vs2015, which luckly can work. It is a strange problem.
have this problem also with vs2019 community. I was trying to create the first 2019 project after it is installed. Then I got this. I ran the install exe file, vs_community.exe again in order to repaire it. But I found out that the install program request to restart the pc to finish the last step. Actually I restarted the pc afterwards manually. But I still did it by clicking on the button "restart pc". After the pc is restarted, the problem is gong. I can create project without any error.

Application crashes on startup - missing Microsoft.VisualBasic.PowerPacks

I wrote a simple VB.NET application which works fine on the development machine.
However on another machine, even though the .NET Framework is installed, it crashes on startup with System.InvalidOperationException.
There seems to be a problem with it finding the Visual Basic assemblies.
Here is one of the fails (I replaced sensitive information with three dots):
*** Assembly Binder Log Entry (16/06/2013 # 15:45:12) ***
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable C:\Users\....
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = ...
LOG: DisplayName = Microsoft.VisualBasic.PowerPacks.Vs, Version=10.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/Users/......
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MSystemAdmin.exe
Calling assembly : MSystemAdmin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.VisualBasic.PowerPacks.Vs, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/.../Desktop/Microsoft.VisualBasic.PowerPacks.Vs.DLL.
LOG: Attempting download of new URL file:///C:/.../Desktop/Microsoft.VisualBasic.PowerPacks.Vs/Microsoft.VisualBasic.PowerPacks.Vs.DLL.
LOG: Attempting download of new URL file:///C:/.../Desktop/Microsoft.VisualBasic.PowerPacks.Vs.EXE.
LOG: Attempting download of new URL file:///C:/.../Desktop/Microsoft.VisualBasic.PowerPacks.Vs/Microsoft.VisualBasic.PowerPacks.Vs.EXE.
LOG: All probing URLs attempted and failed.
It isn't that clear why PowerPacks is missing, the .NET 4 Client Profile could be an issue. There have been multiple versions of PowerPacks around and the version numbering got to be a mess. On my machine, that same version is reported as v2.0.50727, even though it is stored in the GAC as version 10.0
Best thing to do is to go back to your project. Click the "Show All Files" icon on the toolbar in the Solution Explorer window. That now shows the References node. Expand it and select the PowerPacks reference. In the Properties window, change the Copy Local property to True.
Rebuild and your build directory now will have a copy of the DLL. Copy it along with the EXE onto the target machine.
Here is the URL to download Microsoft Visual Basic Power Packs 10.0
http://go.microsoft.com/fwlink/?LinkID=145727&clcid=0x804
Apparently, it seems to be a problem with the "PowerPacks"; these are additional controls to the ones given by default in Visual Studio (in the form design part, under "Toolbox"). If you install the required package on the target computer, everything should be fine.
I had this problem in the past and my recommendation is not relying on these elements: they include nice-to-have features (in my case, it was an elliptic shape) but might be replaced with a bit of work and simpler objects. If you want to sell your program to a more or less wide audience, relying on this might become a problem: this package is not installed by default on virtually any computer and thus you would have to ask your clients to go ahead with the installation. Locating these specific controls is straightforward: on the "Toolbox" they should be listed under "PowerPacks" or similar.
After reading the Hans Passant's comment, I do recall that a .dll file has to be put in the same directory than the executable, but I am under the impression that the PowerPacks package from the provided link has to be installed anyway (at least, on computers not having Visual Studio).
I was upgrading Visual Studio from Visual Studio 2013 to Visual Studio 2015 on a new Windows 10 machine. In doing so I copied my Projects folder from a Windows 7 machine to the same path on the Windows 10 machine.
When I opened a project which used MS.VB.PowerPacks.VS I was informed the file could not be found. I downloaded the newest install for MS.VB.PowerPacks.VS Version 12.0.0.0. Visual Studio 2015 blanked out my form pages which used the PrintForm and informed me:
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualBasic.PowerPacks.VS, Version 10.0.0.0.
I changed the reference to vcersion 12.0.0.0, but it was still not recognized.
My fix: I copied the the C:\Program Files(x86)\Reference Assemblies\Microsoft\VBPowerPacks\v10.0 folder from my Windows 7 machine to my Windows 10 machine, and then removed the v12.0.0.0 reference and added the v10.0.0.0 reference to the program. I then exited the project and opened it again, and all was well, the forms were displayed in their original beauty.

Error in registering COM server from bat file lauched from RunOnce

I am currently working on my product installation in Windows XP 64-bit machine. I am trying to register my COM modules as part of installation. I am doing this by adding an entry in 'RunOnce' (registry) key to launch a bat file and registration is done from that bat file.
All my COM dlls are registered correctly but two of the COM servers (.exe) showing error that it failed to load one of its dependency dll. But the same dll is statically linked with another COM server and this server registered successfully !
And surprisingly running the same bat file directly(double clicking on it) doesn't generate any errors and its works fine for all assemblies!. I have checked this in couple of my test machines only of the machines showing this behavior. Unfortunately that't the customer tool machine.
Its not dependency dll not available issue. Because after registering all files by directly running the bat file, I could reproduce this again by adding a key in RunOnce manually and restarting the machine.
Additional info, I am accessing this machine remotely via logmein.
Exact error message: "This application has failed to start because XXX.dll was not found. Re-installing the application may fix this problem".
This XXX.dll is not available in the same path but its in another folder and its path is available in path variable.
bat file content is;
"C:\WINDOWS\system32\regsvr32.exe" RemoteControlHandler.dll
"C:\WINDOWS\system32\regsvr32.exe" ProcPgmHandler.dll
"C:\WINDOWS\system32\regsvr32.exe" GEM300Handler.dll
"C:\WINDOWS\system32\regsvr32.exe" ICEScreenAdapter.ocx
HIB.exe /regserver //Throws error
JobManager.exe /regserver
Cim300Adapter.exe /regserver
GemEquipmentCtrl.exe /regserver //Throws error
Hope this information is enough for experts, feel free to ask if you need any additional information.
Nixon

Error in reading pdf file

we made one application to read the pdf file and write in Excel.We used iTextSharp.dll.
Application works fine here with windows XP as well as WIndows7.We created this using applicaiton in VB.net in VS2008 version.we have Adobe ReaderX.
But for our customer its not working and it shows error as Unhandled Exception and shows error as
filename.pdf not found as file or resource.
Whats reason for this error message.Customer PC is Windows7 and AdobeReaderX is installed there.
Pls kindly help me.
Random guess? Some directory or filename information is hard-coded into your application. Or the customer is trying to open an incompatible file. Like trying to open a text file with the paint application.