Gacutil Error Code 1
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting gacutil exited with code 3 ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join
Gacutil Exited With Code 9009
the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a the command exited with code 9009 minute: Sign up gacutil postbuild event exists with code 1 up vote 5 down vote favorite 2 I am trying to register and assembly in the GAC on a post-build event. Here's my post-build command "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\x64\gacutil.exe"
Gacutil Exe
/if "$(TargetPath)" I am on x64/Windows 7/VS2010. I am running VS2010 as an administrator and I have UAC turned off (which is pretty much all that my google-fu is finding for this problem). The post build is exiting with code 1 for the all 4 instances of gacutil.exe I can find on my machine. Anyone know a way around this? Thanks in advance. visual-studio-2010 gacutil share|improve this question asked Jul 11 '11 at 20:38 JMorgan 4802920 any solution about it gacutil location ? –Kiquenet May 9 '12 at 7:51 This actually started working after a rebuild of my dev machine. So I am not sure what the issue was. –JMorgan Jun 14 '12 at 12:49 The error that displays in the shell is "Failure adding assembly to the cache: The process cannot access the file because it is being used by another process." –RJ Cuthbertson May 9 '13 at 15:10 add a comment| 6 Answers 6 active oldest votes up vote 9 down vote Copy the full post-build event command string (e.g. ""C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\x64\gacutil.exe" /if "D:\ProjectFolder\Project.Name\bin\Debug\Project.Name.dll" to the clip board, open a command prompt as an administrator, paste the post-build event, and press enter to execute. You'll get a more descriptive explanation of the exit code. In my case, I had my project set to build to the wrong target framework. I switched it from .Net 4 to .Net 3.5 and the error went away. Best of luck share|improve this answer answered Jan 27 '12 at 0:48 rjsidler 9112 Following this suggestion, I had an access denied error. That was fixed by running Visual Studio as Administrator. –Zarepheth Sep 26 '12 at 15:52 This is a good suggestion. In my particular case the output error was that I forgot to sign the assembly. –webwires Mar 7 '13 at 17:01 add a comment| up vote 2 down vote Mine is usually solved by iisreset. share|im
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Solution Converted from Visual Studio http://stackoverflow.com/questions/6656235/gacutil-postbuild-event-exists-with-code-1 2008 Fails Gacutil Post-Build Steps in Visual Studio 2010 up vote 2 down vote favorite 2 I have converted a .NET 2.0 solution containing multiple projects from Visual Studio 2008 (where everything build correctly) to Visual Studio 2010. I loaded the solution in Visual Studio 2010 running in Admistrator mode and selected "Build Solution". The build failed on some post-build steps in some of the http://stackoverflow.com/questions/13828723/solution-converted-from-visual-studio-2008-fails-gacutil-post-build-steps-in-vis projects: Microsoft (R) .NET Global Assembly Cache Utility. Version 3.5.30729.1 Copyright (c) Microsoft Corporation. All rights reserved. Failure adding assembly to the cache: Access denied. You might not have administrative credentials to perform this task. Contact your system administrator for assistance. 36>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(3717,9): error MSB3073: The command ""C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\gacutil.exe" /i MyAssembly.dll" exited with code 1. If I select these same projects, and build just the individual project, rather than the entire solution, then the gacutil command is successful. The error message makes it sound as if permissions are the problem ("Access denied") but I have verified that Visual Studio 2010 is running in Administrator mode -- I see it in the title bar ("MySolution - Microsoft Visual Studio (Administrator)"). Why would gacutil fail when building the entire solution but succeed when just a single project in the solution is built? visual-studio-2010 visual-studio-2008 gacutil post-build share|improve this question asked Dec 11 '12 at 21:22 JeffFerguson 1,974923 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote I recently encountered the exact same problem after converting one of our solutions to Visual Studio 2010. Analysis has demonstrated that if two consecutively compiled project
solution Visual Studio Development > Visual Studio Diagnostics (Debugger, Profiler, IntelliTrace) Question 0 Sign in to vote Hi all, I hope I'm posting myproblemin the right forum.. Anyway, my so wiredproblem is with post-build-events in Visual Studio 2010 and OS 2008 R2 https://social.msdn.microsoft.com/Forums/vstudio/en-US/7b4eb1a4-e4c2-4f0c-ae1a-be20fca93280/gacutilexe-failed-in-post-build-event-when-building-all-solution?forum=vsdebug server. I just converted all our project from VS2005 to VS2010 with almost no effort (3 http://weblogs.asp.net/nilotpal/command-copy-exited-with-code-1 solutions with ~30 projects each). I also moved from OS 2003 to OS 2008 R2 server. All projects have post build event to run SN.exe and GACUtil.exe to add the assemblies to GAC. Whenever I build the solution Iget errors on 3-5 projects related to the post build event script. The output of these errors is about adminisrative permission which is incorrect because exited with the rest of the projects succeded registering to GAC. here's the wierd thing: When I compile only the failed projects, they succeded and display no errors at all. When I try to buildallthe solution again, I get these error again... what is going on? why the GAC failed registering the assemblies when compiling all the solution and succeded when I compile them manually? I read some post that it might have to do with the indexing service but this service exited with code is not installed on my 2008 R2 machine. I need help. Thanks! Roy R.R Monday, August 22, 2011 7:10 AM Reply | Quote Answers 0 Sign in to vote As far as I know, on Windows Vista or later, to install assembly to GAC using GACUtil, you may need to run GACUtil.exe under administrator privilege; If it is a post-build event, you may right-click Visual Studio shortcut and select "run as administrator" to launch VS under admin permission, you can have a try. However, the question is out of support range of this forum, you may try Windows SDK or CLR forum for better support. Eric Yang [MSFT] MSDN Community Support | Feedback to us Get or Request Code Sample from Microsoft Please remember to mark the replies as answers if they help and unmark them if they provide no help. Marked as answer by eryang Monday, September 05, 2011 2:35 AM Tuesday, August 23, 2011 7:58 AM Reply | Quote All replies 0 Sign in to vote As far as I know, on Windows Vista or later, to install assembly to GAC using GACUtil, you may need to run GACUtil.exe under administrator privilege; If it is a post-build event, you may right-click Visual Studio shortcut and select "run as administrator" to launch VS under admin permission, you can have a try. However, the question is out of support range of this forum, you may try Wi
either just before the build of the app or after it. So go to Project Properties -> Build Events and check if there are any pre-build events or post-build events with any copy command. This usually happens when you get a version of legacy code that some other developer has written and are working on some fixes. First check if there are any discrepancies with the copy command syntax or the directory path mentioned therein. If you can't resolve the error because of constraints such as not being able to change the directory structure, just get rid of the commands for the time-being and continue with your dev. You can later on figure out what the original intent of the previous developer was and go for the solution. 73 Comments Verry good post... Cheers Bogdan - Wednesday, May 14, 2008 10:26:14 AM If this is happening with code written by another developer, which you are now working on - you should check that the paths you are copying to and from do not contain spaces. A folder name with a space character will cause this error. Libby - Friday, June 13, 2008 10:22:22 AM Really a great post, Specially comment made by Libby was very useful for me. As the path i was using to copy files contained spaces and was causing this error. Cheers Mohsin - Wednesday, July 2, 2008 1:32:38 AM Thanks man, it was getting really hard to solve this, fortunatly I found your post! Miguel - Thursday, July 10, 2008 1:15:16 PM Hey a very cool post..It helped me to fix this dam error which wasted my 2 dam days.. Thanx.. Purva - Wednesday, July 23, 2008 6:31:31 AM Enclosing paths with double quotes solves the space character problem, for example: copy "path1/files.*" "path2/" olli m - Tuesday, August 26, 2008 1:45:10 PM THanks a lot .. It helped Mannu - Thursday, October 23, 2008 12:53:43 PM My problem was the read only attribute on the file to cover. Thus, I've solved u