Hi @ChiSongTao-1785 ,
I notice that you add the dll in .NET4.0. If you use gacutil to install the assembly to the GAC, it will in .net GAC folder(%windir%\Microsoft.NET\assembly\GAC_MSIL). But it cannot be available in the "add managed module" dropdown in IIS manager. Only assembly in windows GAC folder(%windir%\assembly) can show and gacutil will tell you that assembly is installed correctly in GAC.
Another point is there are two GAC folder.
Microsoft.NET for .net 4.0 and Windows GAC for pre .net 4.0.
If you create assembly in .net3.5 or older, it will installed in windows GAC and can be available in the type dropdown, IIS manager.
If you create assembly in .net4.0, it will installed in Microsoft.NET GAC and not available in the type dropdown.
So the .NET4.0 assembly cannot add by IIS manager. The only way is add it in applicationHost.config manually. The correct process is:
- Create .NET4.0 class library and compile it.
- Install it in the .NET4.0 GAC by using gacutil. ( You have done it.)
- Add this line under
<modules>
in the applicationHost.config:<add name="MyName" type="NameSpace.ClassName" preCondition="managedHandler,runtimeVersionv4.0" />
This make the module run on the requests to sites developed in .net4.0. The requests to sites developed in pre .net4.0 cannot use a module created in .net4.0.
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Bruce Zhang