web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / new CrmServiceClient(c...
Power Apps
Answered

new CrmServiceClient(connectionString); Toss Error =>Error while connecting to CRM Could not load file or assembly 'System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I am trying to follow what it takes to fix the WSTrust issues 

https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/authenticate-office365-deprecation

 

According to this, the only chg needs to be done is:

**

If your code is using CrmServiceClient with the “Office365” authentication type:

An example of this is a connections string that looks like this:

connectionString = "AuthType=Office365;Username=jsmith@contoso.onmicrosoft.com;Password=passcode;Url=https://contoso.crm.dynamics.com"

Similarly, you could also use a CrmServiceClient constructor and pass in AuthType.Office365.

You have two options for dealing with this.

 

***

In my code after above fix, while the compile is fine, during runtime, this is tossing this error in the "new CrmServiceClient(connectionString)"

==> Error while connecting to CRM Could not load file or assembly 'System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

 

Any idea what I need to do to fix this?  Thanks.

I have the same question (0)
  • Verified answer
    johnnyL Profile Picture
    Microsoft Employee on at

    Hi,

     

    This item is closed.    The root cause of this is we had corrupted the VS nuget.   We started debugging with just a console app, got it running.     Then we created an azure function (this is where our code actually runs) and added / updated the nuget as needed to match our current azure function. 

     

    Thanks everyone.   

  • Bhautik Profile Picture
    2 on at

    Hi Johnny

     

    I am facing exact same issue.

     

    I took the all latest nugate packages.. can you please mention which package you are referring ?

     

    The Azure function throws following error if i run from Azure function

    Could not load file or assembly 'System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.


    @johnnyL wrote:

    Hi,

     

    This item is closed.    The root cause of this is we had corrupted the VS nuget.   We started debugging with just a console app, got it running.     Then we created an azure function (this is where our code actually runs) and added / updated the nuget as needed to match our current azure function. 

     

    Thanks everyone.   




Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
wolenberg_ Profile Picture

wolenberg_ 119 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 107 Most Valuable Professional

#3
Haque Profile Picture

Haque 103

Last 30 days Overall leaderboard