Your question is out of the scope of this forum and is related to developers and IT Professionals.
Therefore, I advise you to post it on Microsoft supported products on Q&A | Microsoft Docs.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I've written a number of powershell cmdlets, which I use to help administer the production Windows machines. However when I try to import the module I get the following message;
Could not load file or assembly 'file:///c:\users\Documents\net.production.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. + CategoryInfo : + FullyQualifiedErrorId : System.BadImageFormatException,Microsoft.PowerShell.Commands.ImportModuleCommand
So I thought, not a problem I'll target the framework that is installed on those machines being Net 4.5. However I get the following error;
C:\Users\\Documents\Source\build.csproj : error NU1202: Package System.IO.FileSystem 4.3.0
is not compatible with net45 (.NETFramework,Version=v4.5). Package System.IO.FileSystem 4.3.0 supports:
I then tried to force the version of the package reference but got this error
C:\Users\\Documents\Source\build.csproj : error NU1605: Detected package downgrade: System.
Runtime from 4.0.20 to 4.0.0. Reference the package directly from the project to select a different version.
C:\Users\\Documents\Source\build.csproj : error NU1605: net.production -> System.IO.FileSystem 4.0.0 -> System.IO.FileSystem.Primitives 4.0.0 -> System.Runtime (>= 4.0.20)
So I kept trying earlier and earlier version numbers but ended up with the error;
warn : net.production depends on System.IO.FileSystem (>= 3.0.0) but System.IO.FileSystem 3.0.0 was not found. An approximate best match of System.IO.FileSystem 4.0.0 was resolved.
So I thought I'll install the developer .net 4.5 sdk but ended up with this error;
Same or higher version of .NET Framework 4.5 has already been installed on this computer.
I'm pretty much stumped at this point, I'm not really sure how to proceed. Oh and I'm not able to update the .Net version on the production computers, risk management have deemed the update as too great a risk if impacted.
So I'd like to know how to build the module so that it will run on these older machines.
Thanks
Mark
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Your question is out of the scope of this forum and is related to developers and IT Professionals.
Therefore, I advise you to post it on Microsoft supported products on Q&A | Microsoft Docs.