One of my clients has installed a newer version of SolidWorks. My plugin is also installed on that machine. When the user starts SolidWorks a small progress appear saying "Preparing SolidWorks for first use". The progress never stops, if I click cancel an error occurs and SolidWorks crashes. If I open SolidWorks again same story.
If I uninstall my plugin, SolidWorks starts normally, no more preparing for first installation. Tried installing again my plugin, and when I start SolidWorks the same "Preparing SolidWorks for first use" windows appears and I can not get around it.
Any ideas?
SolidworksApi macros
It seems to be an "user permission" problem. Are u sure that an administrator rights has installed the software (plug-in and/or Solidworks )?
I do not see how this could be a user permission problem. Both SolidWorks and add-in where installed by the same computer user. I do not know if he has administrator rights. How can I debug this problem further?
You should install / uninstall solidworks and your plug-in with Amministrator permissions and anti-virus programs unloaded. You should login on the PC with administration account (user: administrator pass: +++) on the local domain ( your PC ) and not on the net domain. So you can install uninistall the programs and be sure that you are working with admin rights/premissions.
What language and , if applicable, what .NET version ? What is the OS?
Can you try a bare-bones addin and load that ?
the add-in is written in C#, .NET 2.0. The client computer has a Windows XP x64. The new SolidWorks installed is 2010 SP4.
At this moment I cannot try a bare-bone add-in, I will first thing tomorrow.
Sounds like a pretty bad issue if SW is attempting to restore its setting. Try this instead - install your add-in, but then go the the Regedit.exe for the SW add-in GUID in the HKLM\Software\SolidWorks\Addins and change the (Default) value from 1 to 0 for your add-in (so it doesn't load on startup). Now start SW and see if the issue of preparing is gone. Then if it has, go to Tools->Add-ins and load your add-in and see what happens.
Either way sounds like a program with your code.
Luke Malpass
AngelSix (SolidWorks Tutorials and Books)
BatchProcess
I have some news on this problem. After a little debuging I found out what is yhe code that makes SolidWorks crash.
The line is:
CallContext.SetData("MyData", new MyApplicationInfo());
where MyApplicationInfo is a class derived from ILogicalThreadAffinative that I use to comunicate information with my application server. SolidWorks crashes only if I call this in the ConnectToSW add-in method.
I think the problem is that I load my add-in in the same domain with SolidWorks. Any information on this?
Hello - I have a similar problem, and l now get the "Preparing SolidWorks" dialog w/ my add-in and sp 4. I have traced it to when in the add-in I go through the processes on the machine to see if a required program is running. If I by pass this routine, I do not get the "Preparing SolidWorks" dialog. Any thoughts? Thanks!!
Which Add-in is this? I had a similar issue, I dont believe I had any add-ins installed...Its a little late now, but possibly could avoid it in the future.
I had the same issue
but my was how I opened Solidworks
if I used a shortcut/start menu/or the exe file it opened fine
but if I used a program launch(MouseExtender) to start Solidwork I got that error,
the error is now gone but it good to know that it is not the
program launch,
try run the Solidworks.exe with Run( as hold down Shift and right click the Solidworks.exe file and select runas) then type in your window user name and password to see if it happens
that was the workaround i did before the error disapered
If It happens again I will definately try that, seems strange that just using the shortcut would do that.
Forgot to mention before yes if you corrupt any SW pointers or data during initialization you will get this dialog.
ConnectToSW shouldn't be used for too much processor intensive stuff as if you are loading on startup then SW is likely doing a lot too and by nature isn't the most stable of software.
Instead, just to debug the issue, try moving the SetData call to happen when you click a button or something "after" the add-in as loaded. If that is the case and it works fine, consider adding an event handler inside ConnectToSW to your Application.Idle event, then call your initialization stuff inside of that instead as you know SW has finished calling you and is a little more stable.
Once inside the Application.Idle at the last line make sure you remove the event handler else it will be called more than once.
Luke Malpass
AngelSix (SolidWorks Tutorials and Books)
BatchProcess
I like that idea! - Some more info though - this only happens on a site where the workstations have SW installed using the SolidWorks administrative image - and on the machine that is used to create SolidWorks administrative image is does NOT happen, on the machines that have SW installed via SolidWorks administrative image it DOES happen. They are going to do an install of SW via DVDs to see if that avoids the problem.
I did put some logging in the add-in, and it gets in and out of ConnectToSW - I then put an event handler that fires when SW is idle and it never fires - it is hung on the preparing SolidWorks dialog then.
I think if the problem still persists, I will try your recommendation about fully loading the add-in after ConnectToSW - and perhaps using the event handler for idle would be a good trigger to complete loading of the add-in.
Thanks!!
Hi,
Have you tried this :
SolidWorks uses .NET technology and to gain maximum performance the SolidWorks components based on .NET are compiled to native dlls at installation time.
"
Depending on the characteristics of the hardware and the machine load this step may take a few minutes longer than the actual SolidWorks installation.
To ensure correct functioning SolidWorks 2010 SP3 and later will wait for that compilation step to complete, showing the message "Preparing SolidWorks for first use. This may take several minutes."
In case the message does not disappear within a reasonable period of 2 hours, please open a DOS command prompt, navigate to one of these folders:
Use "cd
32bit machine:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
x64 machine:
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727
and type the following command:
ngen.exe executeQueueditems
This should cause .NET to compile all .NET components that have been queued up as soon as possible instead of in the background when the machine is idle.
The .NET components in the queue may come from SolidWorks, 3rd party applications based on .NET, and the .NET framework itself.
On a 64-bit machine, please invoke the above command from both a 32-bit and a 64-bit DOS command prompt.
I have restarted SW after this, waiting appr. 1-2 hour and then it wa working.
Regards,
Alain