Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

System.ServiceModel.Primatives v4.8.1.0 Manifest Definition Mismatch #13868

Open
vsfeedback opened this issue Feb 25, 2021 · 9 comments
Open
Labels
p/UWP s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one.
Projects

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


[severity:Other]
Based on closure and suggested transfer of problem https://developercommunity2.visualstudio.com/t/SystemServiceModelPrimatives-v4810/1325403?entry=myfeedback&ref=native&refTime=1612915194643&refUserId=1f64de6b-9dbf-42ff-ab5b-9e1204f4baa5 and the subsequent closure and suggested transfer back of the problem https://github.com/dotnet/wcf/issues/4523, this problem is reopened here.

When attempting to run a Xamarin.UWP application on Windows v19941.746 with VS 16.9.0 Preview 3.0, I am encountering the following error:

System.IO.FileLoadException HResult=0x80131040 Message=Could not load file or assembly ‘System.ServiceModel.Primitives, Version=4.8.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

A similar error occurs with an Android simulator or phone:

System.TypeLoadException: ‘Could not load type of field ‘Sentry.ISoapServices:SoapClient’ (0) due to: Could not load file or assembly ‘System.ServiceModel.Primitives, Version=4.8.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies.’

The error is not present in debugging an iPhone. The problem was present in v4.8.0.0.

Currently the GAC references the v4.0.0.0 NuGet’s. With the upgrade, the solution and project config files reference the new version, but not the GAC.

Based on the comments in the original problem report, I downgraded to v4.3.0.0 which allows the UWP app to run (not sure why), but not the Androids which reference v4.1.1.0. Downgrading to 4.0.0.0 is not Net.Standard 2.0 compatible. Upgrading to v4.6.0.0 which is NS2.0 compatible results in the current issues. Upgrading to v4.7.0.0 has the same results. As another experiment, I manually replaced the related NuGet's in the GAC with the current versions. Same results.

It appears digging deeper that issue is related to Microsoft.Common.CurrentVersion.targets Line 2181 and the assemblies being resolved against.

As an experiment, removing all "ServiceModel" NuGet's across all five solution projects, cleaning and re-building, I responded to the errors reported by only re-installing the NuGet's necessary to the PCL project. Because of the earlier discovery, I used the v4.1.1.0 versions of the NuGet's. The error is not present in either UWP or Android now.

With it's release, VS v16.9.0 Preview 4.0 is now in use and the problem persisted.

The question in my mind is if the GAC and the assemblies list above are being updated during the NuGet's installations?

The previous problem reports have log files and screen shots of the various builds attached.


Original Comments

Feedback Bot on 2/14/2021, 00:56 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Marc W. George on 2/16/2021, 11:48 AM:

In researching, I discovered the attached .targets file at C:\Windows\Microsoft.NET\Framework64\v4.0.30319. Examining it, I found these specifications for System.ServiceModel.Primitives which don’t list 4.8.1 nor previous v4.x versions that I have used, so I don’t believe it is the active targets specification.

 True   

What I need to know is how to determine which “.targets” file is active so I can examine it. I have 3,524 .target files on my system, but only 5 targeting System.ServiceModel, which all are from 2019. The project was set to use .NET Standard 2.0 for which I don’t find a .targets file. I just upgrade to v2.1 to see if this would help. Is this file associated?

Microsoft.ServiceModel.zip


Original Solutions

(no solutions)

@samhouts samhouts added this to New in Triage Feb 25, 2021
@alaskanrogue
Copy link

This problem is still present with VS Version 16.9.0 Preview 5.0.

@PureWeen
Copy link
Contributor

PureWeen commented Mar 4, 2021

@alaskanrogue can you attach a reproduction please?

@PureWeen PureWeen added p/UWP s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. labels Mar 4, 2021
@PureWeen PureWeen moved this from New to Needs Info in Triage Mar 4, 2021
@alaskanrogue
Copy link

@PureWeen Shane, I will try to produce one. It may take a few days.

@alaskanrogue
Copy link

@PureWeen See attached zip. It contains two solutions. The one with the lower version is operational. The one with the higher version has the new NuGet's and demonstrates the issues, but because of the downsizing of the solution they are being shown as warnings about conflicts, so the app will not break.

One note: When debugging either, there will be an error related to this extension entry in the manifest:

<Extension Category="windows.backgroundTasks" EntryPoint="Sentry.UWP.Background.SentryBackground"> <BackgroundTasks> <Task Type="systemEvent" /> <Task Type="pushNotification" /> </BackgroundTasks> </Extension>
Delete the extension.

Sentry(2).zip

@rachelkang rachelkang moved this from Needs Info to New in Triage Mar 18, 2021
@rachelkang
Copy link
Contributor

Hi, @alaskanrogue - would you mind clarifying what the versions you're working with are? Which was the one that was functional and which was the one where you noticed this issue? (I checked out your repro, and it seemed to me that both projects were on 5.0 and failing to build)

@rachelkang rachelkang moved this from New to Needs Info in Triage Mar 18, 2021
@alaskanrogue
Copy link

Hello @rachelkang The Sentry_v4-5-3 solution should be operational and the Sentry_v4-8-1 solution should not be.

As previously stated, when debugging either, there will be an error related to the following extension entry in the manifest. Delete the extension before building and debugging. (It needs to be deleted repeatedly.) This may be the cause of the failures occurring in both solutions at this moment.

<Extension Category="windows.backgroundTasks" EntryPoint="Sentry.UWP.Background.SentryBackground"> <BackgroundTasks> <Task Type="systemEvent" /> <Task Type="pushNotification" /> </BackgroundTasks> </Extension>

@rachelkang
Copy link
Contributor

@alaskanrogue - thanks for clarifying! I'm able to build now and run now on 5.0 without any issues. I can't see anything about System.ServiceModel.Primitives but am seeing these warnings - does any of this seem to align with the error you're experiencing?

@alaskanrogue
Copy link

@rachelkang Are you saying you have upgraded the System.ServiceModel NuGets in the second solution to v5?

As to your question, I don't recall those warnings, just the error which prompted this problem report.

@Redth Redth removed the s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. label Mar 22, 2021
@a-einstein
Copy link

I seem to be struggling with this problem for at least half a year now now. I have also found similar issues from a long way back.

Some details.

  • Visual Studio 16.9.2.
  • Xamarin.Forms solution for Android and UWP.
  • No problem on Android 10, but crashes on with UWP on Windows 10.
  • Problem occurs in a project on Standard 2.0.3.
  • References System.ServiceModel.Duplex, System.ServiceModel.Http, System.ServiceModel.NetTcp which depend on System.ServiceModel.Primitives.
  • I can use version 4.5.3(!) of those libraries, but anything newer crashes on System.ServiceModel.Primitives, currently searching for 4.8.1.

So please, address this problems as soon as possible. It has been very frustrating to see announcements of a solution in an upcoming Visual Studio, which turned out to be no solution at all!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p/UWP s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one.
Projects
Triage
  
Needs Info
Development

No branches or pull requests

6 participants