Orchard AutoFac Conflicts - orchardcms

I am currently working on a project in Orchard. We are looking to wrap up an existing .NET MVC Web application within an Orchard Module. Currently, we are having issues with AutoFac.
The original site was built using AutoFac 3.5, however the latest stable version of Orchard is still running on 3.0. The application requires features introduced in 3.3. If I install 3.0 into the module, the features do not work, if I have 3.5 in the module, it produces a conflict.
Can anybody suggest a way of handling this conflict? Or, is it safe to upgrade AutoFac 3.0 in Orchard and if so how should I perform this without breaking it?
Thanks,

If I may suggest, Orchard 1.9 should be released soon™ and it already has dependency on latest stable Autofac 3.5.2. If you don't want to wait you can grab latest repository from GitHub
https://github.com/OrchardCMS/Orchard/tree/1.9-int
It's perfectly stable in my opinion and I find released 1.8.1 to be much more buggy :D.

Copy the web.config file runtime Node from Existing Module (Lucene or Markdown or like) and add the runtime node on conflicts Module Web.Config file. After Compile then clear the Conflict

Related

Mathnet.Numerics suddenly requires CUDA DLL

I maintain a .Net Framework 4.0 application (yes, I know) that depends on Mathnet.Numerics 3.11. Recently I started getting DllNotFoundException, saying that I lack MathNet.Numerics.CUDA.dll, when I call either Matrix<T>.Solve(Vector) or DenseMatrix.QR(). I reverted to older versions and found the problem persists. This is crippling for the application, and I'm really hoping to find out what I can do to make it work again. (Separately, I do have a project underway to rewrite the application in .Net 6, but that will not be done soon.)
I did find this GitHub issue which is not encouraging.
Is there a .Net Framework 4.0 version of MathNet.Numerics.CUDA.dll available somewhere? That would probably be the simplest solution, although I suspect it may be hardware dependent.
Just upgrade MathNet.Numerics to 3.20.2 (the latest release within major version 3) and the problem goes away. It appears that the implementation was changed to package the native BLAS providers within the main DLL rather than requiring a separate DLL for each one.

HttpRequestMessageExtensions not being found at run-time in Azure Function

I've got an Azure Function app that creates a precompiled DLL (so it uses normal .cs files, not the older .csx method, pre-VS2017). Previously, it was targeting .Net Framework 4.5.2. I updated it to 4.7 so as to use some of the new C# 7 features. I updated my NuGet packages by doing "Update-Package -Reinstall" and verified that they all have the "net47" target set in my packages.config file.
Everything compiles fine. But when I call a function that uses either of 2 HttpRequestMessageExtensions methods, I get an exception. One example of the exception is this:
Method not found: 'System.Net.Http.HttpResponseMessage
System.Net.Http.HttpRequestMessageExtensions.CreateResponse(
System.Net.Http.HttpRequestMessage, System.Net.HttpStatusCode)'.
Here's an example of a tiny test function that will cause the error:
using System.Net;
using System.Net.Http;
public static HttpResponseMessage Run(HttpRequestMessage req)
{
return req.CreateResponse(HttpStatusCode.Accepted, "");
}
Upon calling this function with say Postman, I'll receive the aforementioned exception. I also get a similar method not found exception when I call GetQueryNameValuePairs() on the HttpRequestMessage.
I've tried updating my NuGet packages to the latest, no difference. I've cleaned and rebuilt and restarted a bunch of times, making sure to nuke my bin and obj directories.
I'm not sure what could be the problem. I guess I could downgrade back to .Net 4.5.2 but I'd rather not. For one, I want to use C# 7, and for two, I want to understand what the problem is rather than avoid it.
Update: interesting. The issue seems to be with System.Net.Http. If I lower it to 4.0.0 everything works fine. If I raise it to any higher version I get the issues listed above. I tried selectively lowering each of my packages, one by one, to their previous version number to find this out. I then updated all but this one to the latest version and it fixed the issue.
I also tested it on my side. The issue is related to the latest version of System.Net.Http assembly(4.3.2). If I don't install this package manually or install the earlier versions(4.3.1/4.3.0), the application could work fine.
The CreateResponse method is a extension method which is written in System.Web.Http assembly(version 5.2.3). It seem that it is not compatible with the latest version of System.Net.Http. Please could just skip the error by using the earlier version of System.Net.Http and you can also submit this issue to Microsoft using follow channel.
https://connect.microsoft.com/VisualStudio/Feedback
Interesting. For me, if I got above version 4.0.0 (including 4.1.1 or 4.3.1) I still get the same problem of not finding those extension methods.
The assembly might not be updated during you change the package version. From the bin\Debug\net47 folder, we could check the current assembly version we used.
If the modified date of assembly is 2/9/2017, the package version is 4.3.1. If the modified date of assembly is 4/19/2017, the package version is 4.3.2. If the assembly is not the latest version, it could work fine on my side.
In addition, Microsoft.Asp.Net.WebApi.Client package is installed by default when creating an Azure function. System.Net.Http is one of its dependencies. So we don't need to install the System.Net.Http package manually. When running our application, NuGet will choose a right version of System.Net.Http for our application.
I had the same issue running my Azure Function locally and eventually tracked it down to conflicting System.Net.Http assemblies. I created my Azure function from a blank ASP.NET Web App and initially pulled down the System.Net.Http NuGet package to use within the project. I also pulled down the Microsoft.AspNet.WebApi.Client for use within the project. It did not matter which version of System.Net.Http I tried my project would compile but fail when the request was made.
Eventually, I removed packages I had downloaded, cleaned the build folder and added just the Microsoft.AspNet.WebApi.Client. I noticed that this automatically referenced the System.Net.Http on my machine for my version of the .NET Framework. (C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework). This compiled successfully and I was able to make requests to the function without any exceptions.
Using #Aaron-Newton's insight, I identified that my issue was due to my Azure Functions project referencing a .Net Standard 2.0 class library. I switched it to .Net Framework 4.6 and it started working again. Seems like this is a bug in the Functions tooling.
I've filed a bug with the Functions team here: https://github.com/Azure/Azure-Functions/issues/477
I had the same issue. I spent quite a while to fix this problem.
The cause is that the Azure Functions project is refering to .Net Standard Library with version higher than 1.4.
Bringing down your .Net Standard version to 1.4 or lower would fix the problem.
But this is defintely a bug with Azure Functions SDK. They should fix it.
https://github.com/Azure/azure-webjobs-sdk-script/issues/980
https://github.com/Azure/Azure-Functions/issues/477

Can't update hot tuna ios dialog support to version 3.5

When I try to update or to install dialog support package I get the error:
Could not install package 'MvvmCross.HotTuna.Touch.Dialog 3.5.0'. You are trying to install this package into a project that targets 'MonoTouch,Version=v1.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
The issue is you are still targeting the old 32 bit only iOS api (the MonoTouch.dll). All apps being written for the store must support 64 bit and 32 bit (Xamarin.ios.dll).
You can I believe get a build of mvvmcross 3.5 that will support the old apis, but I'd look at upgrading your project to support the new iOS apis. Xamarin produce some good docs here: http://developer.xamarin.com/guides/cross-platform/macios/32-and-64/.
This goes without saying but make sure you have everything in source control first before upgrading just in case. Once you have upgraded you should upgrade all mvvmcross components to 3.5

Catel 4.0.0 and Dependency on Microsoft.Bcl.Build

When updating a project to use current Catel version (4.0) I am getting this warning:
All projects referencing MyInfrastructureProject.csproj must install nuget package Microsoft.Bcl.Build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317569.
The error is reported for projects that references MyInfrastructureProject.csproj.
I find it odd that I need to add additional libraries to other project especially when it is concerned with nuget (if I am getting the picture correctly) and not with actual functionality of my code (or maybe even Catel). But in any case, I don't really understand the issue.
I searched a little for this issue but didn't find relevant details or explanations.
Should I go ahead and add the Microsoft.Bcl.Build reference everywhere in my project?
Thanks,
Tomer
If you don't know what is Microsoft.Bcl.Async you should study it.
Catel uses this feature pack so as to use async/await on .NET 4 and Silverlight 5. So if you use Catel in a .NET 4 project, you inherit the same dependencies, which is what the warning says.
Thus, yes, please go ahead and add the NuGet package to the necessary projects, or simply upgrade your projects to .NET 4.5 and reapply the NuGet packages.

Are not templates and codesnippets supposed to get installed with the Catel packages when using the NuGet Package Manager?

I have added Catel.Core 3.7, Catel.MVVM 3.7 and Catel.Extensions.Controls 3.7 to my Project but does not have the codesnippets. I have looked in C:\Users\NNUser\Documents\Visual Studio 2013\Code Snippets\Visual C#\My Code Snippets and no Catel folder there. I can neither find any templates.
I got the impression these should be automatically installed, or do I need to install them manually as indicated in the end of this thread. Seems to be available here but are those version independent?
NuGet isn't the right mechanism to deploy code snippets & templates. It only contains the actual binaries when deployed via NuGet.
They should be installed manually as documented here
The code snippets and templates are mostly version independent, but will always work with the latest version.
btw. why are you using v3.7? The latest version is 3.9 and 4.0 is about to be released

Resources