Task failed because AL.exe was not found,

后端 未结 8 1906
暗喜
暗喜 2020-12-31 06:16

I\'m getting the following error when compiling my project:

Task failed because "AL.exe" was not found, or the correct Microsoft Windows SDK is

相关标签:
8条回答
  • 2020-12-31 06:51

    the problem fixed after I re-install the visual studio

    0 讨论(0)
  • 2020-12-31 06:53

    No need to install VS2010 on the Build servers.

    Export the "v7.0A" key from your dev box, import it into the build server's registry. Just make sure you rename any "Program Files (x86)" to just "Program Files" depending on what version of windows servers you are running.

    0 讨论(0)
  • 2020-12-31 07:02

    Unload your project and then edit your .csproj file you will see an import Task

    <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> 
    

    MSBuildBinPath = "C:\WINDOWS\Microsoft.NET\Framework\v3.5" if ur project is targetting .Net 3.5

    then go to

    C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.CSharp.targets file

    open this file in notepad and search for AL task and you will get something like this

     <AL AlgorithmId="$(Satellite_AlgorithmId)"
                BaseAddress="$(Satellite_BaseAddress)"
                CompanyName="$(Satellite_CompanyName)"
                Configuration="$(Satellite_Configuration)"
                Copyright="$(Satellite_Copyright)"
                Culture="%(Culture)"
                DelaySign="$(DelaySign)"
                Description="$(Satellite_Description)"
                EmbedResources="@(_SatelliteAssemblyResourceInputs)"
                EvidenceFile="$(Satellite_EvidenceFile)"
                FileVersion="$(Satellite_FileVersion)"
                Flags="$(Satellite_Flags)"
                GenerateFullPaths="$(Satellite_GenerateFullPaths)"
                KeyContainer="$(KeyContainerName)"
                KeyFile="$(KeyOriginatorFile)"
                LinkResources="@(Satellite_LinkResource)"
                MainEntryPoint="$(Satellite_MainEntryPoint)"
                OutputAssembly="$(IntermediateOutputPath)%(Culture)\$(TargetName).resources.dll"
                Platform="$(PlatformTarget)"
                ProductName="$(Satellite_ProductName)"
                ProductVersion="$(Satellite_ProductVersion)"
                ResponseFiles="@(AlResponseFile)"
                SourceModules="@(Satellite_SourceModule)"
                TargetType="$(Satellite_TargetType)"
                TemplateFile="$(IntermediateOutputPath)$(TargetName)$(TargetExt)"
                Title="$(Satellite_Title)"
                ****ToolPath="C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727"****
                Trademark="$(Satellite_Trademark)"
                Version="$(Satellite_Version)"
                Win32Icon="$(Satellite_Win32Icon)"
                Win32Resource="$(Satellite_Win32Resource)">
    
                <Output TaskParameter="OutputAssembly" ItemName="FileWrites"/>
    
            </AL>
    

    Note that I chnaged the ToolPath to the location where AL exist on my machine.

    By default it uses $(AlToolPath), Not sure what is the value of this property but i am sure if you are getting this error it is not pointing to correct location

    So in simple words AL task can't find AL.exe and when you edit it and provide it ToolPath value you help him to locate it.

    Hope this explains you why you are getting this error message.

    0 讨论(0)
  • 2020-12-31 07:06

    I had a similar error getting a project building in Windows 10 where a resgen.exe tool could not be found. I had to change a InstallationFolder registry key in HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFX35Tools-x86 to a path where it actually existed on my computer: C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.2 Tools

    0 讨论(0)
  • 2020-12-31 07:08

    You are getting this error because you are building a 3.5 project that uses an assembly manifest, but do not have the 3.5 tools installed. (Hopefully, someone can provide more information.)

    I strongly recommend installing Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1 and avoid the hacks, especially when you only need to install the tools, and be sure to check out the release notes for AL.exe information. (This SDK is the recommended installation for 3.5 due to a security update fix.)

    The "Release Notes" for the SDK indicates that ALTOOLPATH is set by Visual Studio 2005, which might explain why some user have problems building. This is a guess on my part.

    Using SysInternals' Process Monitor, when building a 3.5 project, Visual Studio 2008 looks in the %SystemRoot%\Microsoft.NET\Framework\v3.5 folder for the Assembly Linker (AL.exe). Failing to find AL there, it will use the location specified in the specific v6.0A registry setting. (Note that v6.0A is not for .NET 3.5.) Therefore, install the proper software and do not hack. :O)

    The question I have is the Assembly Linker different between 2.0, 3.0, and 3.5?


    Windows SDK for Windows Server 2008 and .NET Framework 3.5

    Installing the newly released Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1 instead of this release is recommended. If you do go ahead and install this SDK after VS2008 SP1, please ensure the patch described in Knowledge Base 974479 is applied. See Overview section for more information.

    0 讨论(0)
  • 2020-12-31 07:08

    A report was done on Connect, when using TFS 2010 and project targeting the 3.5 framework. Its solution has worked for me.

    https://connect.microsoft.com/VisualStudio/feedback/details/594338/tfs-2010-build-agent-and-windows-7-1-sdk-targeting-net-3-5-generates-wrong-embedded-resources

    0 讨论(0)
提交回复
热议问题