Unity's ResolutionFailedException - unity-container

I have an old Asp.Net web application using Unity for dependency injection.
Today I updated the Unity using NuGet to the latest version. On trying to run the application, I am getting an exception:
Unity.Exceptions.ResolutionFailedException: 'Resolution of the dependency failed, type = 'SOME.Services.ISomeService', name = '(none)'.
Exception occurred while: while resolving.
Exception is: InvalidOperationException - The property converter on type DAL.Repositories.SomeRepository is not settable.
The exception happened on line
_someService = container.Resolve<ISomeService>();
I am very new to Unity. Could you please help?

The newer versions of Unity have breaking changes.
You may want to stick with the older versions of the DLL until you refactor the changes.
v4.0.1 Version 4.x is dead. Loss of original signing certificate made
it impossible to release anything compatible with v4.0.1 release. To
give original developers a credit only about 60 issues were found
during two years in production. To move on and enable further
development version v5 has been created.
v5.x Version 5.x is created as replacement for v4.0.1. Assemblies and
namespaces are renamed and refactored but otherwise it is compatible
with the original. v5.0.0 release fixes most of the issues found in
v4.0.1 and implements several optimizations but the accent was on
compatibility and if optimization would break API it was omitted. Once
stabilized, this version will enter LTS status and will be patched and
fixed for the next few years. There will be no significant development
in this line.
Check their road map here.

Related

ERRORS while building asterisk using meta-telephony layer

I am trying to build asterisk , I am using meta-telephony layer provided from oe-layers.
I have faced few issued while building the application "asterisk" for raspberry pi 3 b.
Initially I have build core-image-minimal for Rpi and it worked successfully.
Tried to build few applications like lighttpd, SQLite3 and they worked successfully.
Now i am trying to build an application called "asterisk" whose recipe is in meta-telephony -> recipe-asterisk-asterisk-asterisk_13.5.0.bb , but I have encountered few errors.
Need guidance for below Error i have faced
WARNING: Layer telephony should set LAYERSERIES_COMPAT_telephony in its conf/layer.conf file to list the core layer names it is compatible with.
WARNING: Layer telephony should set LAYERSERIES_COMPAT_telephony in its conf/layer.conf file to list the core layer names it is compatible with.
Loading cache: 100% |###########################################################################################################| Time: 0:00:00
Loaded 1370 entries from dependency cache.
ERROR: ParseError at /home/bhavya/dialtronics/yocto/poky-dunfell/meta-telephony/classes/waf-samba.bbclass:4: Could not inherit file classes/pythonnative.bbclass
Please kindly help me to solve the issue.
Thanks in advance
bhavya
As far as I see, the last commit on meta-telephony was from 2017. This is long before the Yocto release Dunfell you would like to use.
Mixing meta-layers in different Yocto releases isn't something you do to have fun.
Or you try to find out what release they where using, and go back to these old days. Or you pick up the work and try to maintain a more up to date meta layer.
And to start it, I thing the pythonnative.bbclass is now python3native.bbclass. Note in Dunfell the Python2 support stopped (as in almost all distro?).
BTW: the version in the meta layer is also quite old (13.5.0). Latest version seems to be 17.5.1.

Is mariadb-java-client 2.2.3 compatible with MySQL 8.0?

I'm using mariadb-java-client 2.2.3 to connect to a MySQL server 8.0.11. I'm also using spring-boot 2.0.2. for the application.
On application startup, I'm getting the following execption:
java.sql.SQLException: (conn=9) Unknown system variable 'tx_isolation'
at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:198) ~[mariadb-java-client-2.2.3.jar:na]
at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(ExceptionMapper.java:110) ~[mariadb-java-client-2.2.3.jar:na]
at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(MariaDbStatement.java:228) ~[mariadb-java-client-2.2.3.jar:na]
at org.mariadb.jdbc.MariaDbStatement.executeInternal(MariaDbStatement.java:334) ~[mariadb-java-client-2.2.3.jar:na]
at org.mariadb.jdbc.MariaDbStatement.executeQuery(MariaDbStatement.java:505) ~[mariadb-java-client-2.2.3.jar:na]
at org.mariadb.jdbc.MariaDbConnection.getTransactionIsolation(MariaDbConnection.java:859) ~[mariadb-java-client-2.2.3.jar:na]
According to the MySQL link below, the system variable 'tx_isolation' that was previously deprecated has now been removed. 'transaction_isolation' should be used instead.
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-3.html
Is there a workaround for this issue?
Thanks.
There is no workaround for the moment. Issue has been created on https://jira.mariadb.org/browse/CONJ-604 to handle that for next version 2.2.5.
Currently, MySQL 8.0 is not supported (some tests even freeze the server), so waiting version to be more stable (and a working docker image to test properly with CI).
For people who switch from MySql to MariaDb on their existing SpringBoot project, and face the same issue:
Upgrading mariadb-java-client to 2.6.0+, in your pom.xml solve the issue (most tutorial on the net has 2.1).

VS2017 Could not load file or assembly Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll or one of its dependencies

When trying to open an older solution in VS2017 there is an old Unit Test project that is giving me a problem when building.
I keep getting the following error when building this test project:
Could not load file or assembly 'file:///C:\Projects\MyProj\Test\DAL\UnitTestProj\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll' or one of its dependencies. The system cannot find the file specified.
I checked the project's references and it appears to be referencing Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll. Additionally there are no code errors. How could I ever figure out if it is one of its dependencies that it can't find?
I had a similar issue (with the additional message The "BuildShadowTask" task failed unexpectedly) with a project originally developed with VS2010, and got to spend the last few hours learning about yet another legacy facet of the build process.
There is a good chance that you are dealing with private accessor files (.accessor), which were deprecated in VS2012 (original source). This was foreshadowed in an announcement from the VS2010 team that they were no longer working on these features.
There is also a chance you're just dealing with erroneous refs to the wrong version of UnitTestFramework, but a NuGet restore should fix this. If not, see this GitHub thread for a possible fix (manually change the ref to the public folder), or move to the new MSTest.TestAdapter and MSTest.TestFramework packages (see MSDN support thread).
Solutions
A. Edit the unit test .csproj and change the item Include references from Shadow => None:
<Shadow Include="Test References\namespace.accessor" /> to
<None Include="Test References\namespace.accessor" />
B. Better yet, simply delete all the .accessor files from the unit test project's Test References folder.
Ideally, you would also rewrite your unit tests to remove references to private methods, either by re-architecting to separate concerns or by changing properties to internal and using "friend" with the InternalsVisibleToAttribute.
For those who need to continue supporting testing of private methods for some reason, the same post provides the following suggestions to the logical question "What is available for me then?":
For those who wish to continue testing internal APIs, you have three options:
Use the Microsoft.VisualStudio.TestTools.UnitTesting.PrivateObject class to assist in accessing internal and private APIs in your code. This is found in the Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll assembly.
Create a reflection framework that would be able to reflect off your code to access internal or private APIs.
If the code you are trying to access is internal, you may be able to access your APIs using the InternalsVisibleToAttribute so your test code can have access to the internal APIs.
However, there is not any good replacement for Code Generation for the new features added by the lanugage teams. You may create the TestMethod stubs and then remove the internal code. You only need to keep the stub itself.
Further reading / sources that helped me piece this together:
VS 2005 ASP.NET explanation of accessors
2008 blog article explaining how to work around this for build servers
MSDN forum thread with discussion on accessor purposes, implementations, and workarounds. Start about 1/3 down.
MSDN BaseShadow docs
MSDN PrivateObject class
Right click the project references folder. Add reference > Assemblies > extensions. Check Microsoft.VisualStudio.QualityTools.UnitTestFramework 10.1, and uncheck any older version.
This is related to Visual studio Enterprise 2015, add new load test was failing: and spiting as "Unable to find assembly 'Microsoft.VisualStudio.QualityTools.LoadTest, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Due to Assembly installed in public assemblies shows as version 10.0.0.0 which is missed in GAC,
GAC had only 10.1.0.0. Once GAC updated with 10.0.0.0 and restart VS 2015. should resolve the issue similar to this.
Some more detail for better reasoning, System Assembly path and project path
DLL path
......\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll
.CSProj reference version
I had a same issue while I was upgrading project to .Net4.8 in Visual studio 2022 earlier we were using Visual studio 2017.
Error:
The "BuildShadowTask" task could not be loaded from the assembly ***\Microsoft.VisualStudio.TestTools.BuildShadowsTask.dll. Could not load file or assembly 'file:///***Microsoft.VisualStudio.TestTools.BuildShadowsTask.dll' or one of its dependencies.
Solution : I removed ".accessor" files from project as that is being used for accessing private methods(most probably accessor is depricated). Then we used "PrivateObject" class for accessing private members in UnitTest.
Later we updated Unit Test case. Code references could be found from below articles.
Unit test private methods?
Unit Testing: Exposing Private Members
I had a similar issue (compile project in server Jenkins)
Solution:
Include VS.QualityTools.UnitTestFramework to reference project, whit Pakage Manager:
PM>NuGet\Install-Package VS.QualityTools.UnitTestFramework -Version 15.0.27323.2
https://www.nuget.org/packages/VS.QualityTools.UnitTestFramework
Try to fully uninstall Visual Studio 2017 (not repair). Then download the latest version and install it. Remember to check if MSBuild is added to installation files. Remember to delete folder inside Documents: Documents\Visual Studio 2017. In my case, this simple solution fixed all errors.

Best strategy for upgrading application from Symfony 2.0 to Symfony 2.4?

I need to upgrade an existing rather large application from Symfony 2.0.15 to Symfony 2.4.x (replace with current version).
I'm not quite sure what would be the best strategy to do so. Migration critical features like forms or esi are used, of course :)
Upgrade "step by step" from one major version to another (2.1, 2.2, 2.3, 2.4)
Upgrade directly from 2.0.x to 2.4
Do you have any tips / experience to share ? Would appreciate it :)
Thanks,
Stephan
Each new version comes with an update UPGRADE-2.x.md file containing all intructions to convert your application from the immediately previous version.
I had to do that on my project as well, and I found the step-by-step method more natural and easier to manage. Fact is, there is no file such file as UPGRADE-2.0-to-2.4.md that would help you out for a direct conversion to 2.4.
I shall first recommend to make sure that none of your code uses obsolete functionnalities of Symfony 2.0 (not sure if there are deprecated parts in this version, though), because these can be removed in ulterior versions and will not be included in the UPGRADE file.
If you have done indeep modifications of the core Symfony code, you may find that some undocumented modifications are needed. For instance, there is a custom error handler in my project, extending the Symfony error handler. Well, although it was not documented in the UPGRADE file, the signature of ErrorHandler::handle() was modified and needed to be updated in my custom handler.
Similarly, I had to modify some namespaces because files had been moved in the framework code.
The conversion is still ongoing and I'm currently experiencing a weird error I'm trying to get rid of: The 'request' scope on services registered on custom events generates errors in the logs.

ASP.NET using AtalaSoft to convert Tiff compression

Using Atalasoft's free SDK,
http://www.atalasoft.com/free-dotnet-image-sdk
I added reference to the DotImage and DotImage.Lib dlls' to Visual Studio 2010.
My code:-
Atalasoft.Imaging.AtalaImage image = new Atalasoft.Imaging.AtalaImage(fileName);
Atalasoft.Imaging.Codec.TiffEncoder encoder = new Atalasoft.Imaging.Codec.TiffEncoder();
encoder.Compression = Atalasoft.Imaging.Codec.TiffCompression.Group4FaxEncoding;
image.Save(fileName, encoder, null); // destroys the original.
However when I run the code I get an error on the very first line:-
Unable to retrieve security descriptor for this frame.
Can anyone help me out with this?
Update:-
I added a further line of code:-
System.Security.Permissions.FileIOPermission f2 = new System.Security.Permissions.FileIOPermission(System.Security.Permissions.FileIOPermissionAccess.AllAccess, fileName);
Still the same error.
Philo,
Hi, I'm the support engineer you called in to yesterday. I apologize - after you called in, I received a note from our chief software architect asking us to help you out.
If you are still experiencing your issue, please do call back in and/or create a support case on our portal at https://www.atalasoft.com/support/my-portal/cases
A couple of tings that come to mind from your case: make sure you're targeting either x86 or x64 in your project's platform target (DotImage "has bitness") and make sure you're using the appropriate x86 or x64 Atalasoft references. (I strongly suggest our x86 while getting started as x64 has some additional hoops to jump through to get the licensing working.
Atalasoft does ship some AnyCPU dlls but they're for an extremely limited subset of use cases and if you have referenced those and/or are attempting to target your project to AnyCPU, this will cause all sorts of odd behavior.
Also, if you're targeting our .NET framework 4.0, make sure you're targeting the full framework and not "Client Profile" as DotImage has dependencies on components not present in the Client Profile version.
~DigitalSorceress
Did you have the the file with .lic extension in project section on the right side? Make sure about that.

Resources