wix sfxca binding to CLR v 2.0 instead of v4.0 - wix

Iam building managed custom actions using .net 4.0, but when i package the installer and run it,it fails giving me "assembly is built by newer version" error.
In the install log I can also see that the SfxCA is binding to v2.0 instead of 4.0, how can i configure it so it loads the v 4.0 version
many thanks

Check if this thread is helpful.

Related

The pipeline failed on 'nuget package' restore

I created a pipeline but when the process failed all the time on "Nuget Restore", see error message below.
I don't understand why
Thanks for your help
*The nuget command failed with exit code(1) and error(C:\Program Files\dotnet\sdk\2.2.110\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.0. Either target .NET Core 2.2 or lower, or use a version of the .NET SDK that supports .NET Core 3.0. [D:\a\1\s\PackSecurity\PackSecurity.csproj] C:\Program Files\dotnet\sdk\2.2.110\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 3.0. Either target .NET Core 2.2 or lower, or use a version of the .NET SDK that supports .NET Core 3.0. [D:\a\1\s\PackSecurity.Tests\PackSecurity.Tests.csproj])
Packages failed to restore*
Use "windows-2019" as the agent. Click on "Agent job 1" and set "Agent Specification" as "windows-2019".
Let me know if it worked for you.
According to the error message:
The current .NET SDK does not support targeting .NET Core 3.0. Either
target .NET Core 2.2 or lower, or use a version of the .NET SDK that
supports .NET Core 3.0.
We could to know that you have one or more projects target to the .NET Core 3.0, but the agent you select does not have that version .NET Core installed by default. It should has version 2.2.11 installed.
To resolve this issue, we could add a Use .NET Core task to install the .net core 3.0.x:
Check the similar ticket for some more details.
Hope this helps.

Azure Function Targeting .NET Standard Showing Warning

Just installed Visual Studio 15.5 Preview so that I can create an Azure Function targeting .NET Core. Without making any changes, I'm seeing a warning -- see below -- that reads:
Package Microsoft.AspNet.WebApi.Client 5.2.2 was restored using .NET
Framework version 4.6.1 instead of the project target framework .NET
Standard version 2.0. This package may not be fully compatible with
your project.
Any idea how to fix this or do I ignore this warning? As I said, this is a brand new Azure Function project I created with no changes at all.
Here's what the warning looks like:
You can pretty much ignore it, in this case.
Microsoft.AspNet.WebApi.Client targets "Portable Class Library (.NETFramework 4.5, Windows 0.0, WindowsPhone 8.0, WindowsPhone 8.1, WindowsPhoneApp 8.1)" (or net45+win8+win81 as it's the target framework moniker called), which means it's fully compatible with .NET Core and .NET Standard (>= 1.2).
The warning comes, because it do not target the netstandard1.x or netstandard2.x moniker specifically. It just tell you "this might not be compatible on .NET Core/.NET Standard".
Yes, you did nothing wrong: this is to be expected for now. Functions v2 are in beta now, so you'd have to live with this warning for a while. It should give you no functional issues.

Octopack for .Net 2.0 and msbuild 2.0

I was setting up number of projects to build NuGet packages and push onto NuGet server, so it could be later used by Octopus Deploy.
All was fine until I needed to apply the same process to legacy projects. The error was:
error MSB4062: The "OctoPack.Tasks.CreateOctoPackPackage" task could not be loaded from the assembly ...\OctoPack.Tasks.dll. Could not load file or assembly 'file:///...\OctoPack.Tasks.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. Confirm that the declaration is correct, and that the assembly and all its dependencies are available.
Now I understand that OctoPack was not built for .Net 2.0, but just wonder if anyone hit/solved that problem.
Are you able to change the build target of the application from 2.0 to something more recent? If so, I would upgrade my app, rather than look for a downgraded version of Octopack.
Alternatively, you can use NuGet.exe to create packages rather than using OctoPack. I actually prefer OctoPack, but NuGet.exe wouldn't care about your .NET version.
I ended up amending the Octopack code to work with .Net 2.0 and MSBuild 2, which is successfully applied to all our .Net 2.0 and 3.5 applications being packaged on the CruiseControl server.
If someone is in a similar situation here is the amended code (forked from the original Octopack)

Unable to install .net framework 4.0

I have cleaned up the .net frame work 4.0 from my system using clean utility. It was uninstalled .net frame work framework 4.0. Then i tried to reinstall 4.0 using the set up file got from below link.
http://msdn.microsoft.com/en-us/netframework/aa569263.aspx
But i am getting installation failed error.
Error msg : Installation failed with error code: (0x80070643), "Fatal error during installation.
I am using windows server 2008 32bit OS.
Can any one please give me a solution?
Regards,
Karthik.
This usually means you already have a .NET installation on your system but it's corrupted.
If this is the case you can try the following:
Go to Control Panel->Programs and Features and open the .NET Framework 4 Client Profile installer.
Select Repair .NET Framework 4 Client Profile to its original state. Reboot afterwards.
After this is done try to reinstall .NET Framework 4 using the offline installer
http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=17718

building wix managed Custom Actions in .net 4.0

We just recently upgraded all our code base to .net 4.0, and are trying to build custom actions in our installer using .net 4.0.
We are using wix 3.5 to do that, I am getting BadImageException, saying its built using a newer version of .net runtime than currently loaded.
does wix 3.5's makesxca utility support .net 4.0 ?
Have you tried changing the <supportedRuntime> version in the CustomAction.config to "v4.0"? I didn't try myself, it is just a guess. This article is referenced as the explanation.