Can't Install .35 and .40 versions At the Same Time in Windows Assembly Folder

6 posts, 0 answers
  1. Matthew
    Matthew avatar
    16 posts
    Member since:
    Dec 2004

    Posted 29 Nov 2012 Link to this post

    The title pretty much says it all. My server was giving me the following error "Could not load file or assembly 'Telerik.Web.UI, Version=2012.2.724.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4' or one of its dependencies. The system cannot find the file specified."

    Looking in my Windows Assembly folder I noticed that I had the 2012.2.724.35 assemblies installed, but not the 2012.2.724.40 version. When dragging and dropping the DLLs files to the C:\Windows\assembly folder for version 2012.2.724.35 they installed just fine. However, when I try to do the same thing for 2012.2.724.40 nothing happens and they do not install. I even tried repairing the .NET 4.0 framework and restarting but nothing works.

    I am logged in to the Machine's local Administrator account so there is no reason I can think of why this shouldn't work.


    EDIT: I also want to be clear, that I'm perfectly aware that I can get around the issue by adding the DLL to my application bin folder, however these DLLs are not small, and when I have dozens of applications using them the burden can get quite large. At any rate, it completely defeats the purpose of the GAC (i.e. GLOBAL Assembly Cache).

    EDIT2: Is this true? Did they really remove the ability to add GACs this way in .NET 4.0? I'd really rather not use the Telerik installer as it does not allow any flexibility as to what to install. I just used the 2012.3.1016 installer and I only got the Design binaries which I don't even need. Where are UI and Skins? Ugh!
  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 04 Dec 2012 Link to this post

    Hi Matthew,

    Please note that forth from .NET 40 there is new GAC for 4.0 assemblies and it is located here -> %windir%\Microsoft.NET\assembly\. More information on the topic can be found in this SO thread.

    As for the installer, indeed we only put the Telerik.Web.Design dll there because this ease the design time usage. On the other hand, we found out that the most of our clients prefer the BIN folder approach for the Telerik.Web.UI dll and this is why we don't automatically put it into GAC with our installer. If you want, you can safely place the 4.0 dll into your .NET 40 GAC.

    I hope that this information helps.

    All the best,
    Genady Sergeev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Matthew
    Matthew avatar
    16 posts
    Member since:
    Dec 2004

    Posted 04 Dec 2012 Link to this post

    I actually became aware of the new GAC location about an hour after making this post, but after several trials of adding the Telerik DLLs to sub-folders in this location, I was yet unsuccessful at getting the assemblies to be recognized in my applications. I put the DLLs in folders using the following structure (for example with the UI controls).

    %windir%\Microsoft.NET\assembly\GAS_MSIL\Telerik.Web.UI\v4.0_2012.3.1016_121fae78165ba3d4

    I didn't restart because it was on a production server, so perhaps that had something to do with it? Or perhaps there need to be accompanying Windows registries so VS actually knows they exist when compiling the code? Any ideas on this?

    Thanks, :)
    Matthew
  4. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5800 posts

    Posted 05 Dec 2012 Link to this post

    Hello Matthew,

    The following help article treats this case: http://www.telerik.com/help/aspnet-ajax/introduction-add-to-global-assembly-cache.html.

    Similar reports are abundant in the net and there are some workarounds, for example this tool for WebApplication projects.

    Why Visual Studio wouldn't find the references is a question perhaps only Microsoft could answer. Since the assembly is there and is registered they should find it. From what I can gather from similar complaints in the net - indeed registry manipulation may be required so that third party assemblies are shown in the VS list. After some research in the net here is a list of resources that can be helpful for you in this regard:

    http://msdn.microsoft.com/en-us/library/ftcwa60a(v=vs.80).aspx
    http://support.microsoft.com/kb/306149
    http://msdn.microsoft.com/en-us/library/wkze6zky(VS.100).aspx


    Nevertheless, I can suggest two ways to work around that Visual Studio limitation:

    1) that you add the reference by browsing to the dll (the Browse tab, go to %windir%\Microsoft.NET\assembly\GAC_MSIL\Telerik.Web.UI\v4.0_2012.3.1016.40__121fae78165ba3d4 or whatever the folder gacutil created for you and just add that). It should reference the GAC deployed assembly regardless of the fact that VS cannot find it in the .NET list.

    2) add the reference directly in the web.config, e.g.;
    <compilation debug="false" targetFramework="4.0">
      <assemblies>
        <add assembly="Telerik.Web.UI, Version=2012.3.1016.40, Culture=neutral, PublicKeyToken=121FAE78165BA3D4"/>
      </assemblies>
    </compilation>
    where the version will vary with time, of course. The gacutil tool can be useful with its l-slash to get the exact versions installed in the GAC.

    Regards,
    Marin Bratanov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  5. Matthew
    Matthew avatar
    16 posts
    Member since:
    Dec 2004

    Posted 05 Dec 2012 Link to this post

    My trouble is not with my development machine, but with the server. I can easily work around the issue on my development 
    machine, but the server is another matter. Ideally I would like to be able to simply include the reference to the assembly in my project properties and just have it work, much the same way as I would with any of the .NET assemblies. Unfortunately it seems the DLL must be registered in Windows in order for this to be the case. Since the Telerik installers only install the Design assembly, it seems there is no easy solution unfortunately. Given that I have 10s of applications which reference the same DLLs, it has both an impact on the performance of my apps as well as the disk space of my server since I have to include the assemblies in the bin folder for each app that uses them. Not ideal in my opinion.

    Nevertheless, I appreciate your research and time. I'll certainly take a look into these articles as soon as I can. Thank you! :)
  6. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5800 posts

    Posted 07 Dec 2012 Link to this post

    Hi Matthew,

    Adding a reference from the GAC is essentially modifying the web.config as I have shown below. Thus, when you add the reference to the GAC on your dev machine the same reference should work on the server if the server has the Telerik.Web.UI with the same version installed in its own GAC.

    Adding the dll to the GAC for .NET 4.0 has to go through the gacutil tool, as I already explained, so this procedure on the server is unavoidable, yet it is not complex.

    The registry entries are only necessary for VS to display the desired assembly in its Add Reference dialog. If you add the reference directly in the web.config (or use a third party tool that will add it for you) there is no need to add registry entries neither on your dev machine, nor on your server.

    I hope this clears the situation a bit and will help you use GAC references in your projects.


    All the best,
    Marin Bratanov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top