Loading Native Managed and C ++ DLLs in IIS 7 for a WCF Runtime Project

I have a WCF service developed in C # for the .NET Framework 4.0 for IIS v7. My service is using some managed VC ++ .NET DLL, which internally relies on some native C ++ DLLs.

Now I have the following options:

1) Publish all of my managed DLLs to the GAC (Global Repository) 2) set the PATH environment variable, restart my machine so that the IIS (7) server can receive the changes.

But the client does not want both of the above solutions to be caused by the following reasons; 1) They do not want worldwide 2) Installing PATH, restart the machine for each deployed service .... NAAAAAH !!!!

So, I researched and then discovered that I could install the environment at runtime, so I added some properties to my Web.config file and thought about adding my environment to each service at runtime. But the problem is, where should I write this world of code, as if I added this code to the IIS class, it will fail because it will try to resolve all the dependencies, but fail because my code is not running yet.

Now I want to split my code, which set up the environment in a separate class for each service when the service starts and called it at the end when we deploy.

I'm not sure if this is possible?

PS Please note that I am new to WCF and .NET.

Your help and comments will be appreciated.

-

Sjunejo

+4
source share
1 answer

If you do not set the delay loading property, all uninstalled referenced DLLs will be loaded before your global.asax code is executed, so it is still looking for the wrong place.

You must follow all the steps in Option 2b) if you want it to work.

0
source

Source: https://habr.com/ru/post/1382246/


All Articles