Does restoring a backup of IIS6 restore the GAC? - iis-6

I was wondering: if I have some DLLs in the GAC - will they get restored if I restore a backup of IIS6 on a fresh Windows 2003 box?
Or will I need to backup/rebuild the GAC separately from IIS?

No, assemblies in the GAC will not be backed up by an IIS backup. You will need to re-install your assemblies into the GAC.

Related

Could not load file or assembly 'Microsoft.Owin in Visual Studio

I've got a fresh Visual Studio 2017 installation with a fresh .NET Core 2.0 installation. I've created a .NET Core 2.0 Web project in Visual Studio. Now, when I try to do almost anything in that project (try to open site.js, try to add some files to wwwroot, try to open site.css etc) I get this error:
Could not load file or assembly 'Microsoft.Owin, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
This is a fresh install of Visual Studio 2017, fresh install of .NET Core, and a fresh, untouched project with default settings. What am I doing wrong?
Restarting Visual Studio fixed it. Duh.

asp.net web api system dlls in GAC?

When I create ASP.NET Web API project, it references all system dlls which are stored in packages folder. When I deploy it to production environment, can I drop those dlls in GAC? I don't know why those system dlls not installed in GAC already when I stall asp.net MVC 4. Are they moving away installing DLLs in GAC?
No, do not deploy those DLLs to the GAC.
See this answer: https://stackoverflow.com/a/2451201/48082
Deploy those DLLs to your app bin directory.

AppFabric caching on build server - dilemma with assembly referencing

We have recently added AppFabric as a caching option in our project (Windows server version, not Azure cloud). The project thus now has a dependancy on Microsoft.ApplicationServer.Caching.Client.dll and .Core.dll.
Our build server is Windows 2003 and thus AppFabric cache cannot be installed onto it, thus these assemblies are not available.
Short of including the afore mentioned assemblies as explicit binaries in our SVN repository, and referencing them directly (yuck), are there any suggestions as to how to build the project?
Secondly, if we checked in the binaries, performed the build then deleted them from the output folder, is there a way to force .NET to search the %windir%\system32\AppFabric\ folder for the assemblies?
MS do not register them in the GAC...
If your application is using an assembly that can't be installed on your build server, then the solution is to upgrade your build server to Windows 2008.

Where is GACUTIL for .net Framework 4.0 in windows 7?

i've made an assembly in the .net framework that I intend to publish to the GAC but I can't find the gacutil utlity.
I've been googling a while and I've found a lot of suggestions, but nothing works:
Copy the assemby to %window%\assemby [DOES NOT WORK]
Copy the assemby to %window%\Microsoft.NET\assembly [DOES NOT
WORK]
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\gacutil.exe /i
"assembly" [returns an error: this assembly is built by a runtime newer
than the currently loaded runtime and cannot be loaded]
Does anyone have idea to solve this?
If you've got VS2010 installed, you ought to find a .NET 4.0 gacutil at
C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools
The 7.0A Windows SDK should have been installed alongside VS2010 - 6.0A will have been installed with VS2008, and hence won't have .NET 4.0 support.
VS 2012/13 Win 7 64 bit
gacutil.exe is located in
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools
There is no Gacutil included in the .net 4.0 standard installation. They have moved the GAC too, from %Windir%\assembly to %Windir%\Microsoft.NET\Assembly.
They havent' even bothered adding a "special view" for the folder in Windows explorer, as they have for the .net 1.0/2.0 GAC.
Gacutil is part of the Windows SDK, so if you want to use it on your developement machine, just install the Windows SDK for your current platform. Then you will find it somewhere like this (depending on your SDK version):
C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools
There is a discussion on the new GAC here: .NET 4.0 has a new GAC, why?
If you want to install something in GAC on a production machine, you need to do it the "proper" way (gacutil was never meant as a tool for installing stuff on production servers, only as a development tool), with a Windows Installer, or with other tools. You can e.g. do it with PowerShell and the System.EnterpriseServices dll.
On a general note, and coming from several years of experience, I would personally strongly recommend against using GAC at all. Your application will always work if you deploy the DLL with each application in its bin folder as well. Yes, you will get multiple copies of the DLL on your server if you have e.g. multiple web apps on one server, but it's definitely worth the flexibility of being able to upgrade one application without breaking the others (by introducing an incompatible version of the shared DLL in the GAC).
There actually is now a GAC Utility for .NET 4.0. It is found in the Microsoft Windows 7 and .NET 4.0 SDK (the SDK supports multiple OSs -- not just Windows 7 -- so if you are using a later OS from Microsoft the odds are good that it's supported).
This is the SDK. You can download the ISO or do a Web install. Kind-of overkill to download the entire thing if all you want is the GAC Util; however, it does work.

Install dll into the gac + .net 4.0

I want to add some .net 4.0 dlls to the gac, I know that the new gac is C:\Windows\Microsoft.NET\assembly
I cannot use the gacutil because visual studio in not installed on the deployment machine, and i cannot simply drag/drop the dll to the folder as i usually do in the previous versions.
How can I install the dlls to the GAC.
It is part of Windows SDK and can be download separately at http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6B6C21D2-2006-4AFA-9702-529FA782D63B. This installation will have gacutil.exe included. But first check it here: C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin you might have it installed
where is gacutil.exe?
UPDATE : Modified the link. Windows SDK for .Net 4.0
Using Microsoft Installer Package. You can get download of installer from
http://www.microsoft.com.
I am not confirmed but ideally Gacutil must be part of framework and you can find it out in .net framework folder