none
error CS1606: Assembly signing failed; output may not be signed -- The process cannot access the file because it is being used by another process.

    Question

  • I am getting the following error while using MSBuild: "error CS1606: Assembly signing failed; output may not be signed -- The process cannot access the file because it is being used by another process." This error sometimes occurs and sometimes doesn't while performing a build on the same code base. It also sometimes occurs and sometimes doesn't while using the underlying MS-DOS command. However, it does NOT occur while compiling within VS2005.  It also appears to be the SAME assembly.  Any ideas?

    MSBuild Output:

    Target MasterBuildAndDeploy:
            Target ActualBuild:
                "C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\..\IDE\devenv.exe" C:\Development\Workspaces\saugust\Endurance.Insurance.IITP\main\BuildScripts\..\\Endurance.ESB.sln /Build Debug /Out "C:\Development\Workspaces\saugust\Endurance.Insurance.IITP\main\BuildScripts\..\\Logs\Endurance.ESB.sln.log"
                C:\Development\Workspaces\saugust\Endurance.Insurance.IITP\main\BuildScripts\Endurance.ESB.MGA.Build.Common.Targets(98,3): error MSB3073: The command ""C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\..\IDE\devenv.exe" C:\Development\Workspaces\saugust\Endurance.Insurance.IITP\main\BuildScripts\..\\Endurance.ESB.sln /Build Debug /Out "C:\Development\Workspaces\saugust\Endurance.Insurance.IITP\main\BuildScripts\..\\Logs\Endurance.ESB.sln.log"" exited with code 1.
            Done building target "ActualBuild" in project "Endurance.ESB.MGA.Build.General.proj" -- FAILED.
        Done building target "MasterBuildAndDeploy" in project "Endurance.ESB.MGA.Build.General.proj" -- FAILED.

    VS Output:

    ------ Build started: Project: Endurance.ESB.Schemas, Configuration: Development .NET ------
    Updating references...
    Performing main compilation...
    C:\Development\Workspaces\saugust\Endurance.Insurance.IITP\main\Endurance.ESB.Common\Endurance.ESB.Schemas\MGA_Policy_Request_Envelope.xsd: warning BEC1006: Node "<Schema>" - The distinguished field 'IsValidated' might not exist in the schema.
    C:\Development\Workspaces\saugust\Endurance.Insurance.IITP\main\Endurance.ESB.Common\Endurance.ESB.Schemas\MGA_Policy_Request_XML.xsd: warning BEC1002: Node "EndorsementNumber" - Data type of this field or simple content record (xs:int) and the promoted property 'ns0:EndorsementNo' (xs:string) should be the same or they should map to the same CLR Type.
    C:\Development\Workspaces\saugust\Endurance.Insurance.IITP\main\Endurance.ESB.Common\Endurance.ESB.Schemas\MGA_Policy_Request_XML.xsd: warning BEC1002: Node "EndorsementNumber" - Data type of this field or simple content record (xs:int) and the promoted property 'ns0:EndorsementNumber' (xs:string) should be the same or they should map to the same CLR Type.
    C:\Development\Workspaces\saugust\Endurance.Insurance.IITP\main\Endurance.ESB.Common\Endurance.ESB.Schemas\MGA_Policy_Request_XML.xsd: warning BEC1005: Node "<Schema>" - The promoted field or simple content record 'ns1:IsValidated' might not exist in the schema.
    C:\Development\Workspaces\saugust\Endurance.Insurance.IITP\main\Endurance.ESB.Common\Endurance.ESB.Schemas\PolicyTransactionsBatch.xsd: warning BEC1008: Node "PolicyTransactionsBatch" - Body XPath property is invalid or references a node that may not exist in the schema.
    c:\Development\Workspaces\saugust\Endurance.Insurance.IITP\main\Endurance.ESB.Common\Endurance.ESB.Schemas\AssemblyInfo.cs(21,12): warning CS1699: Use command line option '/keyfile' or appropriate project settings instead of 'System.Reflection.AssemblyKeyFile'
    error CS1606: Assembly signing failed; output may not be signed -- The process cannot access the file because it is being used by another process. 

    Build complete -- 1 errors, 6 warnings 


    Shawn (Mail@ShawnAugust.Com)


    • Edited by SAgosto Wednesday, February 15, 2012 7:12 PM
    Wednesday, February 15, 2012 7:11 PM

All replies

  • Hi SAgosto,
    Based on the error message, it seems that there is another instance locks your file during the build. The following are some suggestions you may to try.
    1. Did you use VS2005 command line prompt to build your solution? if we try to run the prompt as administrator does it work?

    2. When you build your project, is there a visual studio instance launched and opens your file? If we close the VS and try again, does it work?

    3. If we full clean the project, does it work?

    4. Sometimes, an antivirus software may block your file accessing, if we temporary turn it off, does it resolve the issue.

    5. To make sure other software take effects on your build actions, reboot your machine to the safe mode, does it work under safemode?

    6. If all above suggestion fails, please collect more completed log using msbuild switch "/v:d" and more information about your project, it will help to find the root cause of the issue.

    Regards,
    Yi


    Yi Feng Li [MSFT]
    MSDN Community Support | Feedback to us


    Thursday, February 16, 2012 9:14 AM
    Moderator
  • Hello,

    Would you mind letting me know the result of the suggestions? If you need further assistance, feel free to let me know. I will be more than happy to be of assistance.

    YI


    Yi Feng Li [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, February 21, 2012 5:29 AM
    Moderator
  • Hello,

    Would you mind letting me know the result of the suggestions? If you need further assistance, feel free to let me know. I will be more than happy to be of assistance.

    YI


    Yi Feng Li [MSFT]
    MSDN Community Support | Feedback to us


    My apologies as I have been bogged down with production issues. I'll get to this shortly and reply back with my findings.

    Shawn (Mail@ShawnAugust.Com)

    Tuesday, February 21, 2012 1:33 PM
  • Hi SAgosto,
    Based on the error message, it seems that there is another instance locks your file during the build. The following are some suggestions you may to try.
    1. Did you use VS2005 command line prompt to build your solution? if we try to run the prompt as administrator does it work?

    2. When you build your project, is there a visual studio instance launched and opens your file? If we close the VS and try again, does it work?

    3. If we full clean the project, does it work?

    4. Sometimes, an antivirus software may block your file accessing, if we temporary turn it off, does it resolve the issue.

    5. To make sure other software take effects on your build actions, reboot your machine to the safe mode, does it work under safemode?

    6. If all above suggestion fails, please collect more completed log using msbuild switch "/v:d" and more information about your project, it will help to find the root cause of the issue.

    Regards,
    Yi


    Yi Feng Li [MSFT]
    MSDN Community Support | Feedback to us


    1. This is a Windows Server 2003 machine and my user has Admin access. Using the VS2005 IDE, compilation is always successful. The corresponding command line prompt will generate the same build error.
    2. Compiling via MS-DOS command line or using MS-Build using the same approach does not launch VS
    3. Not that I noticed. I was tempted to compile via IDE and just have MS-Build use those DLLs/resources/etc but I prefer no manual process.
    4. Sophos Protection is running. I am not sure if I can remove that easily as it is locked down via my company. I can look into that.
    5. I will try this.
    6. I will do this as well.


    A reboot seems to work sometimes.

    Shawn (Mail@ShawnAugust.Com)

    Friday, February 24, 2012 10:32 PM
  • Thanks for update.

    We are looking for your good news.


    Yi Feng Li [MSFT]
    MSDN Community Support | Feedback to us

    Monday, February 27, 2012 8:52 AM
    Moderator
  • Compiler Error CS1606:

    My solution is uninstall the antivirus software (BaiDu antivirus software). then the world clean.

    Tuesday, December 17, 2013 12:39 AM
  •  You may take a look at this link

    Error Deploying Visual Studio Workflows

    See if this helps


    Strive to shew thy self approved. A workman that needs not be ashamed. Please, endeavor to mark a post as answer if it solves your issues.

    Thursday, April 24, 2014 8:56 AM