Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations JAE on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programming in Visual Studio and Attaching to ugraf.exe

Status
Not open for further replies.

EngProgrammer

Aerospace
Joined
Jan 14, 2015
Messages
150
Location
US
I typically program within visual studio vb.net and during development of an application I am building an application and then attaching it to the process of nx (ugraf.exe). Typically, this works fine but for some reason now, I cannont attache to the process after I have attached to the process and my program crashes and I try to re=attach again. I keep getting the following error::

Error 17 Could not copy "obj\Debug\iRotorForging.dll" to "bin\Debug\iRotorForging.dll". Exceeded retry count of 10. Failed. iRotorForging

It's like NX still has a hold of the DLL and is not letting it go.

 
If your program crashes, then it's quite likely that your GetUnloadOption function is not being executed. If that is the case, then NX does indeed still have hold of your DLL, as you suspected. That's why the copy operation can't replace the DLL.
 
This is just a workaround: Try deleting the obj folder created under application directory before building...
If it works write a "Pre-build event command line" in visual studio for deleting this folder.

Thanks,
Prasanna M
 
What GetUnloadOption did you use for the compiled .dll? If you are using an option other than Immediately, then yes, NX will hold onto the .dll until NX terminates, or you explicitly unload it.

www.nxjournaling.com
 
Sorry. My mistake. I forgot to add the following subroutine illustrated below at the end of my nxopen function. What other types of these little tricks do people know about that tend to trap us???

Code:
   Public Function GetUnloadOption(ByVal dummy As String) As Integer
        GetUnloadOption = UFConstants.UF_UNLOAD_IMMEDIATELY
    End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top