locked
aspnet_merge.exe and .NET 4 GAC Resolution Issues RRS feed

  • Question

  • I am having issues with the aspnet_merge.exe utility that may be related to this movement of the GAC assemblies to a different folder http://social.msdn.microsoft.com/Forums/en-US/netfxgeneralprerelease/thread/351a3cd6-1f25-40d3-86be-17f7d88790a8.

    Essentially, the merge appears to succeed; however, the following error message is kicked out  when I run it.  Not sure if this should concern me or not?   Is this related?  Will the new aspnet_merge.exe located under C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\ recocognize the .NET 4.0 GAC?  Is this a bug?

    We are currently using the Release Candidate for .NET 4.  Details below...



    Utility to merge precompiled ASP.NET assemblies. Version 3.5.30729.
    Copyright (c) Microsoft Corporation 2007. All rights reserved.

    aspnet_merge: error occurred: An error occurred when merging assemblies: Unresolved assembly reference not allowed: System.Web.
    C:\dev\Software\Core\WebApp>


    // Merge log output

    Running on Microsoft (R) .NET Framework v2.0.50727
    mscorlib.dll version = 2.0.0.0
    The list of input assemblies is:
        App_Web_3u4enayg.dll
        App_Web_5b5vuxtw.dll
        App_Web_qhnperdc.dll

        // blah blah blah

    All input assemblies have a compatible PeKind value.
    AssemblyResolver: Assembly 'App_Code' is referencing assembly 'System.Web'.
        AssemblyResolver: Attempting referencing assembly's directory.
        AssemblyResolver: Did not find assembly in referencing assembly's directory.
        AssemblyResolver: Attempting input directory.
        AssemblyResolver: Did not find assembly in input directory.
        AssemblyResolver: Attempting user-supplied directories.
        AssemblyResolver: Did not find assembly in user-supplied directories.
    AssemblyResolver: Unable to resolve reference. (It still might be found, e.g., in the GAC.)


    // Batch used to compile and then merge our web application.
    SET WIN_SDK_BIN="C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\"
    SET MS_BUILD="C:\Windows\Microsoft.NET\Framework\v4.0.30128\"
    SET MS_BUILD_PROPERTIES="configuration=Release;TargetFrameworkVersion=v4.0"
    REM Dev Branch
    SET APPDIR=".\PrecompiledWeb\WebApp"
    SET MERGELOG=".\PrecompiledWeb\WebAppMergeLog.log"
    %MS_BUILD%msbuild.exe /v:normal /t:Clean;Rebuild /p:%MS_BUILD_PROPERTIES% WebApp.sln
    %WIN_SDK_BIN%aspnet_merge.exe -o WebUI.dll %APPDIR% -log %MERGELOG% -r -a -copyattrs
    
    Monday, March 1, 2010 4:36 PM

Answers

  • What's weird is that aspnet_merge.exe logs that something is running on .NET 2.0. I can easily imagine that some 4.0 reference (e.g. System.Web) cannot be found then.
    Can you check aspnet_merge.exe config file (if there's any) or somehow check which version of .NET it is running on? Or what exactly is using .NET 2.0?

    Also I think that ASP.NET forums (http://forums.asp.net) might be better place for your question, can you try it too? (And link it here for future reference)

    -Karel
    • Marked as answer by kfkyle95 Tuesday, March 2, 2010 7:54 PM
    Tuesday, March 2, 2010 6:04 PM
    Moderator
  • Using the the aspnet_merge tool located under "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\" instead of "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\" resolved this issue for me as well. I also needed to include to the -a switch.

    Issue resolved.



    Wednesday, March 10, 2010 4:13 PM

All replies

  • What's weird is that aspnet_merge.exe logs that something is running on .NET 2.0. I can easily imagine that some 4.0 reference (e.g. System.Web) cannot be found then.
    Can you check aspnet_merge.exe config file (if there's any) or somehow check which version of .NET it is running on? Or what exactly is using .NET 2.0?

    Also I think that ASP.NET forums (http://forums.asp.net) might be better place for your question, can you try it too? (And link it here for future reference)

    -Karel
    • Marked as answer by kfkyle95 Tuesday, March 2, 2010 7:54 PM
    Tuesday, March 2, 2010 6:04 PM
    Moderator
  • Karel,

    Thanks for the timely response.  I posted my question on the asp.net forums as you suggested under the ASP.NET 4 RC group.   I also made a correction to my original post as follows.  In the post, I indicated that the merge appeared to succeed; however, this was not the case.  It simply errors out.

    http://forums.asp.net/t/1531658.aspx
    Tuesday, March 2, 2010 7:54 PM
  • Still no response on this one.  I am going to submit an MS Connect issue on it since it would be a deployment showstopper to us if we can't resolve it.
    Wednesday, March 10, 2010 1:11 PM
  • MS Connect issue created. I've also been able to recreate it with a newly created VS 2010 RC/.NET 4 solution containing a WebSite and class library project. https://connect.microsoft.com/PowerShell/feedback/details/540895/aspnet-merge-exe-and-net-4-resolution-errors#
    Wednesday, March 10, 2010 2:21 PM
  • Using the the aspnet_merge tool located under "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\" instead of "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\" resolved this issue for me as well. I also needed to include to the -a switch.

    Issue resolved.



    Wednesday, March 10, 2010 4:13 PM