Assembly Binding Redirection: v4 app using v2 libraries, need to be using v2 redirects - .net-4.0

What is the best way to configure my .Net 4 application to use the third party library redirects located in the .Net 2 machine.config other than copying the entries?
If copying the entries is the only way, how can I do that using InnoSetup?

I added a .Net executable to handle copying the entries and launched it from my InnoSetup script.

Related

SkiaSharp with ASP.NET Core on Ubuntu

I want to use SkiaSharp on my ASP.NET Core web app on Ubuntu. I have read articles on this but I think I am missing something. Let's say my server is configured well, .NET Core is installed, SkiaSharp is git-cloned/built using the steps in https://github.com/mono/SkiaSharp/wiki/Building-on-Linux, my web app is git-cloned+built/deployed+configured, and referencing the SkiaSharp NuGet. When the web app runs, does it automatically use the .so file? If now, how would they work together?
So, just an FYI for those reading this in the future.
Back then, there was not pre-built library for linux, so you had to do your own. Then (what I think the OP is missing) you references the .so file using Content and a CopyToOutput.
Now...
Just reference the SkiaSharp.NativeAssets.Linux NuGet package.

How to publish a web application project with third party DLL (zkemkeeper.dll) that causes an error?

I have .net core web application project which using a third party DLL (zkemkeeper.dll a C++ DLL). Adding this library to my VS project is fine.
I can add it as a reference and everything works fine when I tried to run it. However, VS didn't recognize the library of this DLL as you can see on the below image.
So due to this issue I can't publish the project? Any tricks on this?
Just do the following steps,
1. Register zkemkeeper.dll in server (where your side is hosted)
2. Also register above dll on the computer where you are developing it.
Note: best way to register dll of zkemkeeper
download sdk of 32/64 bit from http://www.zkteco.eu/index.php/downloads/software-downloads
run Auto-install_sdk file as a administrator or system.
it will automatically register required dll into your system
Thanks
Just sharing, I've already fixed the issue by using the DLL generated in my bin folder (Interop.zkemkeeper.dll). Now my only problem is this one.

Creating a .NET application without the entire framework?

I am in the process of creating a lightweight application in vb.NET, and was wondering if it is possible to create an application that uses some of the dll's within the .NET 2.0 framework, without actually using the framework itself.
For instance, can I take the dlls from the .NET directory that the app will reference (and only those dlls that it references), put them into a folder inside the app's directory, and then just change the reference path to that new location? That way, when the app is installed on pc's without .net framework installed, the dlls can just be zipped and copied over to the newly installed app directory.
This may all sound a bit confusing, just let me know if you need any more info.
It is quite unlikely that you'll be able to do that.
There is this thing called .net framework client profile for creating lightweight .net apps that do not need the whole framework but you still need to have that installed.
I would recommend using something like Delphi if you need a standalone exe that does not depend on anything.
There is concept of Client Profile in .NET 3.5 and .NET 4.
That is subset of .NET, smallest necessary fraction of .NET that client must have in order to be able to run .NET applications targeting client profile.
There is more detailed overview of the features you may use when targeting client profile.
Unless you move to .Net 4 or above, you need full framework on the client computers. Having said that, which OS are you targeting? Newer MS OS often come with .Net framework installed already.

Why can't my .NET 4.5 project use a DLL compiled for .NET 4? (Both use EF 5)

I have an application that consists of a client-side application and a WebApi website.
My client-side stuff is targetting .NET 4 so that I don't have to insist that users install .NET 4.5. My website, however, is entirely under my control, so I'm targetting .NET 4.5.
There is one shared assembly, which I use for data access. It uses Entity Framework 5.
When I build the client application, the DLL used is version 4.4.xxx, whereas when I build the web application, the DLL is 5.0.xxx.
Up until now, I've been able to run the client application with no problems, and I've also been able to run the web application, again without problems.
However, I've now re-created my web application project from scratch (*), and suddenly I can't run it. I get a YSOD saying "Could not load file or assembly 'EntityFramework, Version=4.4.0.0 ..." at the point where my data-access assembly is first invoked.
Now, it's perfectly clear what that error means - it can't find the v4.4 DLL as used by the data-access assembly - but I don't understand why that's a problem with my new project when it wasn't a problem with my old project. As far as I can see, the same DLLs are referenced in each project.
(*) I should explain why I'm re-creating my project. I originally created the project in VS 2012 RC, and then later upgraded to the release version. Although this supposedly upgraded my project, I've had a few problems with it, and have also noticed some differences v. a newly-created project. So, to be on the safe side - and hopefully circumvent those other problems - I'm re-creating it from scratch.
So, my question: why is this suddenly a problem, and what can I do to resolve it?
Is the code depending on the assemblies set to require the exact version? If so, you will need a publisher policy for the EntityFramework assembly or bindingRedirect for the referencing application (web project).

Web site to dll

I need to compile my web site, is it possible without converting to a web project first?
I think he wants to "protect" his code for any deployment.
If this is a .Net project you can try hide some code using codebehind components in ASP.NET.
Here is an small tutorial about it:
http://asp.net-tutorials.com/basics/code-behind/
For older projects you may have to build a cgi binary application, but as already mentioned here, add some more details to specify your problem.
I think you want a VS Web Deployment project. This exists as a separate project in your solution but can compile and copy the existing web project to a different directory.
There's a reasonable write-up of it on this blog with step-by-step instructions. You'll need to download and install the new project type separately though (2008, 2010)