Created a .NET Framework class library with strong name added an Nuget reference.
Registered the .NET framework class library dll in GAC.
Added the reference from GAC path in SSRS reports file.
System.MethodAccessException is thrown.
Related
The project is a Class Library which I want to use it from a Visual Foxpro application. Visual Foxpro is 32bit.
.Net project:
Target framework .Net Framework 4.7.2
Target Platform x86.
Using Newtonsoft.Json and RestSharp
I registered the DLL using RegAsm and I am able to create an object of that from Visual Foxpro. Things are fine, if I simply do some string manipulation and I am getting return value from DLL into Visual Foxpro program.
Now, when I enable RestSharp, it breaks and throws below error:
*OLE IDispatch exception code 0 from System.Memory: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified...
*
I am not sure how this version conflict came up when I installed packages afresh and have not copied any file manually.
Any clue?
Thanks in advance
Rajesh
My Visual Foxpro test folder is different and I have copied all files from my .Net Debug folder into that folder.
I added a class library project to my .net core 5 solution. I realized that it doesn't contain configuration files that other project types normally do, such as appsettings.json. And it doesn't have the Startup.cs either. I wonder if I can simply add them into the project? If I do, will they work just like they do in other project types? I need this project to be able to read from configuration file and load services and pipelines in Startup.cs.
This is more of a 'why is .NET okay with this?' kind of question. The documentation for migrating to 3.0 said to that NewtonsoftJson is no longer built into the shared framework.
I have a couple libraries that are netstandard2.0 which use Newtonsoft.json package in which my 3.0 application is dependent. However, I am getting no complaints from my 3.0 application by just using using Newtonsoft.Json in the file. I don't have the recommended 3.0 Mvc.NewtonsoftJson package in the 3.0 project file either.
This article mentions using the System.Text.Json NuGet package in .netstandard projects. Should I be doing this then?
ASP.NET Core Mvc no longer uses Newtonsoft.Json as the default json serializer but, it could still be enabled with:
Install the package with dotnet add package Microsoft.AspNetCore.Mvc.NewtonsoftJson --version 3.0.0-rc1.19457.4
Add AddNewtonsoftJson() after AddMvc(), AddControllers(), AddRazorPages(), or AddControllersWithViews().
System.Text.Json is recommended as default but there is no reason for ASP.NET Core to disallow you to useNewtonsoft.Json, it just does not include or use it as default.
You could continue to use Newtonsoft.Json in your .NET Standard 2.0 library project, but for better performance, you could install the package with dotnet add package System.Text.Json --version 4.6.0-rc1.19456.4 and migrate all uses of Newtonsoft.Json to System.Text.Json. But note that System.Text.Json is still very new and not as full-featured as Newtonsoft.Json, and some behavior would differ.
I am compiling a desktop application in Visual Studio 2010 and it cannot find MySql component. It complains in using MySql.Data.MySqlClient; directive:
The type or namespace name 'MySql' could not be found (are you missing a using directive or an assembly reference?)
There is a reference to MySql.Data and MySql.Data.dll is in bin folder.
Never mind. MySql.Data.dll was for other .NET Framework version. Replaced it with the right one.
I receive the following error on the Windows App Certification Kit for Windows 8.1.
The app manifest test detected the following errors:XXX takes a
dependency on Microsoft Visual C++ Runtime Package
(Microsoft.VCLibs.110.00) framework but is missing the framework
dependency declaration in the manifest.
My solution builds with zero errors. However, I receive an error after I create an app package and run the Windows Application Certification Kit.
I have added and removed references to the C++ runtime extension.
In addition, I do not see any fields in the app manifest editor to modify that would resolve this dependency error.
It sounds like you are including a library that was built with Visual Studio 2012. You will need to rebuild that library in Visual Studio 2013. If you just have the binary you will need to get an updated version from the author.
..
Or
Rename "Microsoft.VCLibs.110" to Name="Microsoft.VCLibs.110.00",
Or
Add a reference in your project to Microsoft Visual C++ Runtime Package
Add reference and find this Package. Adding this should resolve your problem