Clr Assembly must have main file specified error when you register an assembly from a shared network drive - by GregGalloway

Status : 


Sign in
to vote
ID 779739 Comments
Status Active Workarounds
Type Bug Repros 2
Opened 2/21/2013 12:36:42 PM
Access Restriction Public


Go to and download the ASSP 2012 assembly (the zip file, not the XMLA file). Unzip that file, unblock the DLL as described here:

Then copy the DLL to a shared drive like \\servername\sharename\ASSP.dll

Map \\servername\sharename as the P: drive.

Open Management Studio 2012 not with "Run as Administrator" (so it will be able to see the P drive). Register the ASSP assembly from the P: drive. You will get the error "Clr Assembly must have main file specified". The same happens if you try to register it from \\servername\sharename\ASSP.dll.

Incidentally, the same error happens if you don't unblock the DLL.

I think what's happening under the covers is that the Microsoft.AnalysisServices.ClrAssembly class is swallowing an error and not reporting it. If when it loads the DLL it doesn't successfully find any files, it needs to report the error that prevented it from finding any files rather than continuing on. If it continues on, it sends XMLA to the server that doesn't specify any <File> nodes, and the server gives the "Clr Assembly must have main file specified error" error. It shouldn't get as far as sending the XMLA to the server, in my opinion. It should provide a more helpful error message before then.

More background here:
Sign in to post a comment.
Posted by Robert Heinig III on 10/2/2014 at 4:14 AM
"I think what's happening under the covers"
I think looking at the script button output or Mikhail's workaround more or less proves your interpretation. What SSMS should be doing is to pull the DLL's binary content from the UNC path using the current user's credentials, base64 code it and put it in a Data block of the xmla. It fails despite there being no reason - the user can copy the file, so SSMS should be able to read the bits, regardless of path type. The error message obviously results from SSMS sending an incomplete script, indeed there is no File element with Type=Main. The Dialog has more flaws - a second attempt gives an even less appropriate error message (assembly already exists).

Should be easy enough to fix!