开发者

How can use topologymanager obsolete Namespace in Custom SharePoint Web Service?

开发者 https://www.devze.com 2023-02-28 01:31 出处:网络
I am unable to Use the Topologymanager class inside the namespace Microsoft.SharePoint.Portal.Topology. I searched a lot. Its urgent. Thanks

I am unable to Use the Topologymanager class inside the namespace Microsoft.SharePoint.Portal.Topology. I searched a lot. Its urgent. Thanks

I am getting the following error. When I include the namespace "Microsoft.SharePoint.Portal.Topology" in my Custom Web service.

A runtime exception was detected. Details follow. Message: Cannot open database "WSS_Content_Dev3" requested by the login. The login failed. Login failed for user

Techinal Details: System.Data.SqlClient.SqlException: Cannot open database "WSS_Content_Dev3" requested by the login. The login failed. Login failed for user . at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)

at System.Data.SqlClient.SqlInternalConnectionTds.Open开发者_如何转开发LoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at Microsoft.Office.Server.Data.SqlSession.OpenConnection() at Microsoft.Office.Server.Data.SqlSession.ExecuteNonQuery(SqlCommand command) at Microsoft.Office.Server.Data.SqlDatabaseManager.HasAccess(String user) at Microsoft.Office.Server.Administration.SharedResourceProvider.SynchronizeAccessControl(SharedComponentSecurity sharedApplicationSecurity) at Microsoft.Office.Server.Administration.SharedResourceProvider.Microsoft.Office.Server.Administration.ISharedComponent.Synchronize()





Finally got the solution:

When you Use the templogymanager inside the web service directly or even include the namespace "Microsoft.SharePoint.Portal.Topology" at the top of the custom web service. It gives you error. I did the following thing.

  1. I create the helper project in which I used the namespace Microsoft.SharePoint.Portal.Toplogy.
  2. Compile it and put the dll into GAC.
  3. Add the .dll reference to my project.
  4. Then I called the helper Method in my custom web service.
  5. Problem Solve.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号