Quantcast
Channel: Microsoft Identity Manager forum
Viewing all articles
Browse latest Browse all 7443

Sometimes: Unable to load assembly

$
0
0

Not sure that this is a FIM question exactly, but here goes.

I'm running FIM 2010 SP1 on a Windows Server 2012 box.

When running my Powershell import script (below) from a prompt, it runs perfectly always;

$SqlConnection = New-Object System.Data.SqlClient.SqlConnection
$SqlConnection.ConnectionString = "Persist Security Info=False;Integrated Security=SSPI;database=xxxx;server=server,port;Connect Timeout=30"
$SqlCmd = New-Object System.Data.SqlClient.SqlCommand
$SqlCmd.CommandText = $sql
$SqlCmd.Connection = $SqlConnection
$SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
$SqlAdapter.SelectCommand = $SqlCmd
$DataSet = New-Object System.Data.DataSet
$null = $SqlAdapter.Fill($DataSet)
$SqlConnection.Close()
$global:users = $DataSet.Tables[0]

However when run from my PS MA, I sometimes get this error

29-04-2013 08:54:32: System.Management.Automation.RuntimeException: Unable to find type [assembly.reflection]: make sure that the assembly containing this type is loaded.

It is the System.Data.SqlClient.SqlConnection, that cannot be loaded.

What is really killing me, is that it runs fine "sometimes", usually if I don't touch the box for a while it works (I have scheduled tasks running the import as well). I can't seem to figure out what the ... is going on - it seems as if some DLL or similar is unloaded and then the import script works fine for a while. But the strange thing is that it runs perfectly from a PS prompt everytime.

Suggestions?


Regards, Soren Granfeldt
blog is at http://blog.goverco.com | facebook https://www.facebook.com/TheIdentityManagementExplorer | twitter at https://twitter.com/#!/MrGranfeldt



Viewing all articles
Browse latest Browse all 7443

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>