Transaction Scope Compiler Warning

Hello Epiusers,

Our pilot environment just updated, and in my custom code I’ve started getting the following compiler warning:

warning CA1416: This call site is reachable on all platforms. ‘TransactionScope.Complete()’ is only supported on: ‘Windows’.

Can someone offer some insight as to this?

Thanks

2 Likes

Doing a bit of research here and without reaching out to @bconner and his team, it may be an oversight with respect to how they are handling platform specific validation, in the release you are on. Previously Epicor have enabled compiler warnings for specific things (System.IO… and that’s a totally different thread, go and search the forum for that one)

It may also be useful to let us know what specific versions of .net you have on your machine. 2024.2 so I’m assuming it is going to have to be .net 8. fixes come out on a regular basis.

If you could provide a sample of some of your code that are you are using that may help us to test on other versions/platforms.

Here are a few links:

Personally I have not seen that compiler warning appear in my environment.

Other hardcore devs out there it would be useful to hear your feedback.

I’ve seen this message too, and am curious why it’s appearing.

I am getting this as well.

Generate.Post.CR2929_A.cs(119,17): warning CA1416: This call site is reachable on all platforms. 'TransactionScope.Complete()' is only supported on: 'Windows'. @timshuwy, @bconner any wisdom?

2 Likes

Platform specific code! It helps makes things like .NET MAUI easier to house in single solutions, though it’s for all cross-platform code.

It means that this was marked as platform specific code and that your compilation always reaches this code (making it error if deployed and called from a platform other than Windows).

Interested to see why platform stuff was added. (or if it is 3rd party code) :slight_smile:

we are getting Transaction Scope errors as well. Was happening in production prior to update this weekend and is still happening this morning. It’s a BPM that fires when adding parts to a custom forecast program. The BPM is working but i’m curious about the validation error and if i should be concerned?
the program was developed by Epicor’s Custom solutions group and they couldn’t figure it out last week either.

Your error is not the same type. That is a local machine error. If you save, it will be fine.

There is likely a folder you will have to delete to correct it. Let me see if I can find the thread.

Unless @olga remembers first…

1 Like

I also just discovered if I remove the custom code from my BPM, I continue to get these errors. That’s a new one for me.

I cannot find anythig similar, probably because people just show screenshots instead of writing the error itself. :woman_shrugging:
But the error you mentioned was because of SDK not correctly installed locally and I don;t think this is the same. In that case it was erroring everything starting with String

3 Likes

It was the same solution, you find your thread?

1 Like
2 Likes

Instead .net sdk 6.x as in the link, you need to check if 8.x installed correctly on the local machine

3 Likes

@Olga no luck with this. Did anyone find this worked for them?

do you have .NET Sdk 8x installed locally? show us:

dotnet --info

2 Likes

Didn’t work for me. I removed 6.0x of the SDK and already had 8 installed. Still seeing the errors. Maybe an issue with ARM in my case?

I found old topic

it is indeed only about installing SDK…

Hey all, I just ran into this today too. Different setup to @brandtley (on prem, 2024.1.19, RDS distribution with no clients on users’ machines) but had BPMs that worked in Dev but not Prod, SOMETIMES.

After reading everything on this forum with “dotnet” in it, I found that I had left SDK 6 as well as SDK 8 on my appserver and 1 of my terminal servers. It was frustrating because it usually worked but sometimes didn’t, until I realized it was only when we spilled over onto TS3 AND did something that used that BPM. I uninstalled SDK 6 fomr both places where it was trying to live with 8, and everything is fine now.

@Olga is it possible our Epicor hosted server (which we don’t have access to) has SDK 6 installed on it?

1 Like

Could you use string version = Environment.Version.ToString(); and output to something to check?