Assemblies not found for Visual Studio

Asked

Viewed 3,217 times

0

Hi, I’m working with Visual Studio It’s the first time I’ve come across this message while trying to debug the program:

"C: Program Files (x86) Microsoft Visual Studio 2017 Community Msbuild 15.0 Bin Microsoft.Common.Currentversion.targets(1126.5): error MSB3644: The reference assemblies for the structure ". Netframework, Version=v4.5" not found.

To resolve this, install the SDK or Targeting Package for that version of the structure or redirect the application to a version of the structure for which you have the SDK or Targeting Package installed. Note that the assemblies will be resolved from the GAC (Global Assembly Cache) and will be used in place of the reference assemblies. This way, your Assembly may not be correctly directed to the desired structure."

I would like to know what I would need to do in order to compile in the version that is mine .NET Framework (if I’m not mistaken, it’s 4.7.0). I’ve tried changing the version parameter to 4.7.0 in the three files. config that the program has, but the compiler still seems to reference version 4.5.

Thanks for your help.

  • Tried to automatically reference another . NET Framework (like v4.6) in project settings?

1 answer

1

I’ve had the same problem.

Navigating to the folder bin, you can check line 1126 of the file `Microsoft.Common.Currentversion.targets. Soon you come across:

<!-- By default if there is no root path set then the task will assume it is Program Files\Reference Assemblies\Microsoft\Framework-->
    <GetReferenceAssemblyPaths
        Condition="'$(TargetFrameworkMoniker)' != '' and ('$(_TargetFrameworkDirectories)' == '' or '$(_FullFrameworkReferenceAssemblyPaths)' == '')"
        TargetFrameworkMoniker="$(TargetFrameworkMoniker)"
        RootPath="$(TargetFrameworkRootPath)"
        BypassFrameworkInstallChecks="$(BypassFrameworkInstallChecks)"
        >
      <Output TaskParameter="ReferenceAssemblyPaths" PropertyName="_TargetFrameworkDirectories"/>
      <Output TaskParameter="FullFrameworkReferenceAssemblyPaths" PropertyName="_FullFrameworkReferenceAssemblyPaths"/>
      <Output TaskParameter="TargetFrameworkMonikerDisplayName" PropertyName="TargetFrameworkMonikerDisplayName" Condition="'$(TargetFrameworkMonikerDisplayName)' == ''"/>
    </GetReferenceAssemblyPaths>

Probably when trying to compile your application, the visual studio does not is finding references to such Assembler, Note the comment before the tag GetReferenceAssemblyPaths who says q if he doesn’t find such reference, it should assume the ones inside the folder C:\Program Files\Reference Assemblies\Microsoft\Framework. if you is referencing a Assembler that does not exist so the IDE will beget the Exception.

To change the project’s Target Structure you can:

  • Right click on the project and select the SubMenu Propriedades. inserir a descrição da imagem aqui

To use the version that does not exist, just downlaod the framework in question?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.