Unable to deploy smartpart on moss 2007

May 15, 2009 at 12:30 PM


I am using wspbuilder to create and deploy features onto moss2007 and it all works fine and well. Thanks for the product. Now, I needed to create a custom control which could use the Ajax functionality of collapasible panels. So I downloaded Return of Smartpart and successfully deployed. I can drag and drop all the sample user controls and the ajax enabled sample user controls on my moss webpart. All works well and that means my installation is successful and moss server is ready to deploy the smartparts with or without ajax.

Now my problem, i want to create my custom control which has to use Ajax collapsible panel control and then use enterprise library 4.1 to get the data. So i downlaoded the smartpart web template as a project template and tried to build a blank user control, which just gives a response.write("hello") message. When i click build WSP, all files seem to be getting created in right folders with no compile time errors, but when i click deploy. It gives me the following error message:-

Upgrading the solution!



Created by Carsten Keutmann

GPL License 2007

Install and deploying ExamEntriesSmartPart.wsp

Unable to deploy solution

Inner exception(1): This solution contains one or more assemblies targeted for the global assembly cache. You should use a strong name for any assembly that will be in the global assembly cache.

Initially I thought, may be i need to put my Ajax control toolkit.dll and enterpriselibrary in gac and thats why its not working.

But i have another feature built and deployed using WSPBuilder (Nothing to do with smartpart, just uses wspbuilder), where i use enterprise library and it works fine. Then i thought, may ajax dll needs to go in gac. As i was not sure, i removed everything from my smartpart and just built a blank project (Smart part webpart(smart template) project and even then the following error occurred. This error still comes even if It have set no reference to any ajax or enterprise library dlls. Please help and show me a light. My clock is ticking and deadline is approaching fast. cheers!


May 18, 2009 at 3:43 PM

The above error of Inner exception(1): This solution contains one or more assemblies targeted for the global assembly cache. You should use a strong name for any assembly that will be in the global assembly cache, still appears when I try to deploy the usercontrol using the menu option.

After a lot of looking around I found that this is not a correct way to deploy the custom usercontrol onto smart part. On the filesystem, a setup directory gets created under the project directory. This setup directory contains the .wsp file and a setup.exe file. Double click, the setup.exe file and it will automatically deploy the important files of the usercontrol in proper directories. that is  wss\virtualdirectories\80\bin\xx.dll and wss\virtualdirectories\80\usercontrols\xx.ascx and wss\virtualdirectories\80\usercontrols\xx.ascx.cs.

So my smartpart is deployed and shows the custom control also, but when i try to access enterprise library 4.1 from inside the user control. I am unable to create the connection.




<font size="2">



Database db = ENT.DatabaseFactory.CreateDatabase("somestring");

DbCommand dbCommand = db.GetSqlStringCommand("some sql statement");<font size="2">

dbCommand.CommandType =



int i = db.ExecuteNonQuery(dbCommand);

Then the error comes and my webpart doesnot display properly. My connection string is correct and sql statement displayes correct result on sql management studio. When i check the event log, the following error message appears.

Any help is appreciated? I donot know, which user and what permissions its talking about? Sql user seems to be correct as many other application using the same user are working correctly. Error message is attached below:

A runtime exception was detected. Details follow.

Message: User does not have permission to perform this action.

Techinal Details:

System.Data.SqlClient.SqlException: User does not have permission to perform this action.

at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)