msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

Add Ability to suppress MSB3270 at the individual assembly for a specific mismatch.

Open vsfeedback opened this issue 1 year ago • 2 comments

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


Currently it is possible to completely suppress the warning

 <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
        None
    </ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>

This is problematic when C++/CLI is referencing Managed (AnyCPU), using platform specific dll's for the managed assemblies is NOT a solution.

Since this is a non-problem at runtime it would be beneficial to specify

--- Suppress Warning for My.Special.Selection.cll" when it is "AnyCPU"

This would allow other mismatches which may be important to generate warnings but the specific occurances of specific types would be suppressed.


Original Comments

Feedback Bot on 6/27/2022, 09:29 AM:

(private comment, text removed)

vsfeedback avatar Jan 30 '24 16:01 vsfeedback

I have a similar problem: Having a special Hosting-Assembly (AnyCPU) which can load and start either a 32- or 64-bit host process (exe). These two host processes are referenced by the Hosting-Assembly, so they are getting copied and the location can be extracted with e.g. typeof(Program32).Assembly.Location or typeof(Program64).Assembly.Location

It would be greatly welcomed to suppress the message for exactly these two host process assemblies.

The current warning is also propagated to other assemblies using the Hosting-Assembly, which I want also to suppress.

gerhard17 avatar Apr 25 '24 10:04 gerhard17

@gerhard17 for your specific scenario, does the actual Hosting-Assembly need to directly reference the host process assemblies? In many such cases those would be invisible to ResolveAssemblyReferences by using <ProjectReference Include="..\x86host\x86host.csproj" ReferenceOutputAssembly="false" /> or similar.

rainersigwald avatar Apr 25 '24 14:04 rainersigwald

@rainersigwald Thank you for your input! Your idea is good, but i didn't achieve to get the hosting assemblies automatically get copied over into dependent projects. But i will hold that idea in mind!

gerhard17 avatar May 18 '24 13:05 gerhard17