msgraph-sdk-dotnet icon indicating copy to clipboard operation
msgraph-sdk-dotnet copied to clipboard

Error CS8103 after upgrading the Sdk from 4.18.0 to 5.x.x

Open victorolawale opened this issue 9 months ago • 5 comments

I recently upgraded from 4.18.0 to any of the versions 5.x.x. I have been getting Error CS8103 while building my project.

image

I wanted to be sure of the problem so I downgraded to version 4.54.0 and the project was able to build. image

I have also read the guide on upgrading to v5. There seems to be nothing that points to this compile time error.

In addition, I have also tried to search online on a work around that is relevant to my use case, nothing seems to solve the issue. However, I am very sure the problem was from the v5.x.x of the Microsoft.Graph Sdk.

Error CS8103: Combined length of user strings used by the program exceeds allowed limit. Try to decrease use of string literals.

Please help as I am currently blocked.

victorolawale avatar Oct 14 '23 18:10 victorolawale

Yes. Having the same problem here as well.

Using Microsoft.Graph in an internal library that is used in an Orleans Grain (targeting netstandard2.0 and net7.0) to create users in Azure B2C.

Today, I upgraded this to the latest version (Microsoft.Graph version 5.36.0) and started seeing the same error above:

CS8103 - Combined length of user strings used by the program exceeds allowed limit. Try to decrease use of string literals.

Only removing this reference (even if it's transitive) from the project containing the grains does this error resolve.

Actually.....

I did some testing, and managed to determine that:

  • This issue occurs with Microsoft.Graph version 5.36.0
  • This issue does not occur with Microsoft.Graph versions 4.54.0

So I, too, have rolled back. But it'd be nice to see the latest version of the the library usable from Orleans.

bgreen77 avatar Dec 14 '23 12:12 bgreen77

Yes. Having the same problem here as well.

Using Microsoft.Graph in an internal library that is used in an Orleans Grain (targeting netstandard2.0 and net7.0) to create users in Azure B2C.

Today, I upgraded this to the latest version (Microsoft.Graph version 5.36.0) and started seeing the same error above:

CS8103 - Combined length of user strings used by the program exceeds allowed limit. Try to decrease use of string literals.

Only removing this reference (even if it's transitive) from the project containing the grains does this error resolve.

Actually.....

I did some testing, and managed to determine that:

  • This issue occurs with Microsoft.Graph version 5.36.0
  • This issue does not occur with Microsoft.Graph versions 4.54.0

So I, too, have rolled back. But it'd be nice to see the latest version of the library usable from Orleans.

bgreen77 avatar Dec 14 '23 12:12 bgreen77

Same here. Getting the same error error CS8103: Combined length of user strings used by the program exceeds allowed limit. Try to decrease use of string literals. while using <PackageReference Update="Microsoft.Graph" Version="5.41.0" />

Is there a plan fix for this issue?

ilanhu avatar Feb 11 '24 12:02 ilanhu

I think this issue only happens on any project targeting below .NET7.0.

I upgraded the project to NET8.0 and also have the SDK upgraded. It works and resolves the issue.

victorolawale avatar Feb 16 '24 13:02 victorolawale

Hi @andrueastman is there any update on this? We're also blocked on this issue and are unable to upgrade to NET8.0 as a potential mitigation

evanweissms avatar Apr 09 '24 20:04 evanweissms