GAC assembly found but not in C:\Windows\assembly\ - .net-4.0

Notice how the 4.0 version of the ODP.NET Oracle Provider (Oracle.DataAccess.dll) shows up in the GAC when I search for it using the gacutil.exe utility. But it doesn't exist in the C:\windows\assembly\ folder. Why would that be? How can I find and extract that dll from the GAC? Only the 2.x assemblies are in the folder.
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools>gacuti
l /l Oracle.DataAccess
Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.33440
Copyright (c) Microsoft Corporation. All rights reserved.
The Global Assembly Cache contains the following assemblies:
Oracle.DataAccess, Version=2.112.1.0, Culture=neutral, PublicKeyToken=89b483f4
29c47342, processorArchitecture=x86
Oracle.DataAccess, Version=2.112.3.0, Culture=neutral, PublicKeyToken=89b483f4
29c47342, processorArchitecture=x86
Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f4
29c47342, processorArchitecture=x86
Number of items = 3
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools>

Looks like the dll was in a different folder.
C:\Windows\Microsoft.NET\assembly\GAC_32\Oracle.DataAccess\v4.0_4.112.3.0__89b483f429c47342\oracle.dataaccess.dll

Related

VS 2019, VB, Class Library, getting error "Could not load file or assembly 'System.Runtime, Version=4.2.2.0, Culture=neutral" during RegAsm

It's my 1st time trying to build a .DLL in .Net, for use with a VB5 program...I'm a newbee
Windows 10, VS 2019, VB, building a Class Library Target framework is .NET Core 3.1.
RestSharp 106.15.0 in Assemblies, Newtonsoft.Json 13.0.1
getting error
"C:\Users\User\Desktop\PSMdata\aaaOther>regasm.exe IQProLnk.dll /tlb:IQProLnk.tlb
Microsoft .NET Framework Assembly Registration Utility version 4.8.4084.0
for Microsoft .NET Framework version 4.8.4084.0
RegAsm : error RA0000 : Could not load file or assembly 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified."
I've looked at everything I could find doing a Google search.
I've tried adding a System.Runtime through NuGet, but all I could find is 4.3.1.... it still wants 4.2.2.0
As suggested by someone who did a C# program and had the same problem, I've added (to no avail):
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken= "b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="4.0.0.0"/>
</dependentAssembly>
to "C:\Users<user>\AppData\Local\Microsoft\VisualStudio\16.0_cd2f1afe\devenv.exe.config"
Some one suggested "modify the app.config entry to match packages.config for the newVersion", but I cannot find either one of those config files. But this was for VS 2017 anyhow.
I've searched all the files in the IQProLnk subdirectories for any reference to System.Runtime and all I found was this in the IQProLnk.vbproj file after I added System.Runtime in NuGet
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="System.Runtime" Version="4.3.1" />
</ItemGroup>
Otherwise I don't know what it is that wants v4.2.2.0.
I hope I haven't been to verbose but did give enough information.
Thanks

Found conflicts between different versions of "Newtonsoft.Json" that could not be resolved

After upgrading VS2019 Enterprise edition to latest version: 16.9.4 , when I tried to build a project with Target Framework: NET Framework 4.7.2 , I am getting the below errors :
Found conflicts between different versions of "Newtonsoft.Json" that could not be resolved.
7>c:\program files (x86)\microsoft visual studio\2019\enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3277: There was a conflict between "Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" and "Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed".
7>c:\program files (x86)\microsoft visual studio\2019\enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3277: "Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" was chosen because it was primary and "Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" was not.
7>c:\program files (x86)\microsoft visual studio\2019\enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3277: References which depend on "Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed" [<Path to the project>\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll].
7>c:\program files (x86)\microsoft visual studio\2019\enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3277: <Path to the project>\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll
7>c:\program files (x86)\microsoft visual studio\2019\enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3277: Project file item includes which caused reference "<Path to the project>\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll".
7>c:\program files (x86)\microsoft visual studio\2019\enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2182,5): warning MSB3277: Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL
Similarly for System.Net.Http.Formatting , System.Web.Http
Can anyone help me here by providing their guidance in fixing this issue
Unfortunately things like this are a bit of a pain to resolve. If you open the Error List window (View --> Error List) you'll get a bit more detail. There should be a warning in the Error List with the dependencies causing the conflict. It's not intuitive what's causing the problem but you can figure it out if you spend the time reading through the entire warning. Essentially it boils down to getting packages to versions where all the dependencies are consistent.

The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime" from TeamCity

I'm getting the above error from our TeamCity build.
I have tried adding the following lines to the web.config.
<assemblies>
<add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</assemblies>
I have also installed the latest Windows SDK for .NET4.5.2.
Neither of these have resolved the error.
Any ideas?
Finally found a solution to this problem. I added a reference to the System.Runtime.dll assembly to my project. I added a reference to the following file to my project (substitute your own version of .NET in the path as necessary). You could always copy the file to your project folder and link it from there as an alternative.
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Facades
This worked for me and hopefully will work for someone else.

System.Data.OracleClient Missing From .NET 4.0?

I'm having trouble building my .NET 4.0 application. Getting this warning:
The primary reference "Microsoft.Practices.EnterpriseLibrary.Data,
Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35,
processorArchitecture=MSIL" could not be resolved because it has an
indirect dependency on the framework assembly
"System.Data.OracleClient, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" which could not be resolved in the
currently targeted framework. ".NETFramework,Version=v4.0". To resolve
this problem, either remove the reference
"Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35,
processorArchitecture=MSIL" or retarget your application to a
framework version which contains "System.Data.OracleClient,
Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089". EBRX
The solution has three projects in it, all of which are pointing at the 4.0 framework (not client). Still getting the error. Can anyone help?
Thanks in advance,
Brandon
Please make sure that you have a reference to System.Data.OracleClient:
Just for your notice:
The Types in System.Data.OracleClient (.NET Framework 4) namespace are deprecated and will be removed in a future version of the .NET Framework.
As you can see on https://msdn.microsoft.com or http://blogs.msdn.com.

How do I make the MSBuild task in Mono's xbuild use the .NET 3.5 framework?

I'm trying to build a MonoTouch project using xbuild (on a Mac, clearly). Here's my xbuild project:
<Project DefaultTargets="Application" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ApplicationProjectFilePath>..\TestApp\TestApp.csproj</ApplicationProjectFilePath>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<MonoTouchReferencePath>/Developer/MonoTouch/usr/lib/mono/2.1/</MonoTouchReferencePath>
</PropertyGroup>
<Target Name="Application">
<MSBuild Projects="$(ApplicationProjectFilePath)" Targets="Rebuild" Properties="Configuration=AdHoc;Platform=iPhone;ReferencePath=$(MonoTouchReferencePath)" ToolsVersion="3.5"/>
</Target>
</Project>
When I run this, I get the following warning:
/Library/Frameworks/Mono.framework/Versions/2.6.7/lib/mono/3.5/Microsoft.Common.targets: warning : Found a conflict between : 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' and 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Using 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' reference.
How can I have xbuild reference v3.5 of the framework? As you'll see from the script, I've tried a number of approachs, none of which seem to be working.
[Also, I'm not sure why I have to explicitly reference the monotouch.dll library - given that it's referenced in the project file (TestApp.csproj). Any comments on that would also be appreciated.]
MonoTouch uses a superset of the Silverlight framework, not 3.5, and there are currently no xbuild targets for MonoTouch and its framework version. Implementing this will require custom targets that override framework assembly resolution, like the Silverlight and MonoDroid targets.
For now, I suggest you use the build command of MonoDevelop's commandline tool, mdtool, i.e.
/Applications/MonoDevelop.app/Contents/MacOS/mdtool build