I'm trying to use the EXEC NAnt task to launch REGSVR32.EXE to register a dll in my Teamcity CI Build Script. However it keeps returning code 3 on anything I attempt to register. Would anyone know what a return code 3 means? Anyone have this issue before?
Asked
Active
Viewed 348 times
2 Answers
1
According to this answer the error code can be found on the System Error Codes page. Looking at that page error code 3 means ERROR_PATH_NOT_FOUND so from that I'm guessing that either the path to REGSVR32.EXE isn't found or the path to your DLL isn't correct.
-
Ok thank you. That's odd because I added code to test for existance of the files before it's executed and it returns true. – Jim MacDiarmid Feb 14 '14 at 11:56
-
In that case are you sure that you are trying to register the DLL at the correct path, i.e. no typo's / wrong path variables etc.? Also if there are spaces in the path then make sure you add quotes to prevent the path from being split incorrectly. – Petrik Feb 15 '14 at 20:04
-
Yes, At this point just to test to see if it will register at all I've hardcoded the path to regsvr32.exe and the path to the dll I'm attempting to register. I still get a return code 3. This only happens in Teamcity. – Jim MacDiarmid Feb 17 '14 at 14:15
-
1In that case the only things I can think of are either a) somehow the Teamcity machine doesn't have regsvr32 on that path or b) somehow the Teamcity user doesn't have access rights to either regsvr32 or the dll. – Petrik Feb 17 '14 at 18:43
-
It looks like there may be some sort of Teamcity Environment issue going on. I changed the script name that it calls in the Teamcity NAnt step 1 configuration and now calling a plain build script and I can get dlls, etc to register. – Jim MacDiarmid Feb 18 '14 at 08:54
-
Good that you found it. You may want to add your own answer to the question and mark it as an answer in that case. – Petrik Feb 18 '14 at 18:44
1
Your path for the DDL's may exists which will then try to register the dlls, but if you are using NAnt, then it probably does not know where to find REGSVR32.EXE.
You need to define that in a property then use that property to register then DDLs, as that is probably causing code error 3.
<property name="REGSVR32.EXE" value="C:\Windows\System32\REGSVR32.EXE" />
Also, make sure your 'TeamCity Build Agent Service' is not using the LocalSystem account but infact some admin user.
Geddon
- 1,266
- 1
- 11
- 31