error MSB4057: The target "CreateGeneratedAssemblyInfoInputsCacheFile" does not exist in the project
Posted: Tue Sep 12, 2023 1:23 pm
Hi.
When upgrading from Xsharp v2.11 to 2.14, we started getting this error during compilation: "error MSB4057: The target "CreateGeneratedAssemblyInfoInputsCacheFile" does not exist in the project"
This happens because XSharp.CurrentVersion.targets now contains the following target:
<Target Condition =" '$(GenerateAssemblyInfo)' == 'True'"
Name="XsCoreGenerateAssemblyInfo"
DependsOnTargets="CreateGeneratedAssemblyInfoInputsCacheFile"
Inputs="$(GeneratedAssemblyInfoInputsCacheFile)"
Outputs="$(GeneratedAssemblyInfoFile)">
<ItemGroup>
<!-- Ensure the generated assemblyinfo file is not already part of the Compile sources, as a workaround for https://github.com/dotnet/sdk/issues/114 -->
<Compile Remove="$(GeneratedAssemblyInfoFile)" />
</ItemGroup>
<WriteCodeFragment AssemblyAttributes="@(AssemblyAttribute)" Language="$(Language)" OutputFile="$(GeneratedAssemblyInfoFile)">
<Output TaskParameter="OutputFile" ItemName="Compile" />
<Output TaskParameter="OutputFile" ItemName="FileWrites" />
</WriteCodeFragment>
</Target>
(My highlight)
For now I've just worked around the issue by adding an empty target with the name CreateGeneratedAssemblyInfoInputsCacheFile to my xsharp projects, but it would be nice to know what the idea here is, so I can figure out what might possibly be broken.
Are we expected to hit https://github.com/dotnet/sdk/blob/main ... rgets#L171 ?
I wasn't able to pinpoint anything in the whatsnew pdf that could explain this change, but I don't work in xsharp very often, so something might've gone over my head. Any input would be appreciated.
I've searched the forum for the term 'CreateGeneratedAssemblyInfoInputsCacheFile' without finding anything.
My environment:
Microsoft Visual Studio Professional 2022
Version 17.7.3
VisualStudio.17.Release/17.7.3+34024.191
Microsoft .NET Framework
Version 4.8.09032
Installed Version: Professional
Visual C++ 2022 00476-80000-00000-AA667
Microsoft Visual C++ 2022
ASP.NET and Web Tools 17.7.273.65229
ASP.NET and Web Tools
Azure App Service Tools v3.0.0 17.7.273.65229
Azure App Service Tools v3.0.0
C# Tools 4.7.0-3.23416.8+43b0b05cc4f492fd5de00f6f6717409091df8daa
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
NuGet Package Manager 6.7.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
Razor (ASP.NET Core) 17.7.3.2333001+0ab18affdf2a37647768d0e25f5f021bee6257a1
Provides languages services for ASP.NET Core Razor.
SQL Server Data Tools 17.7.10.1
Microsoft SQL Server Data Tools
TypeScript Tools 17.0.20628.2001
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 4.7.0-3.23416.8+43b0b05cc4f492fd5de00f6f6717409091df8daa
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual F# Tools 17.7.0-beta.23314.10+e612cf93b989503c89e3a5830090062b7ab5e143
Microsoft Visual F# Tools
Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.
WiX Toolset Visual Studio Extension 1.0.0.22
WiX Toolset Visual Studio Extension version 1.0.0.22
Copyright (c) .NET Foundation and contributors. All rights reserved.
X# Visual Studio Project System 2.17.0.3
When upgrading from Xsharp v2.11 to 2.14, we started getting this error during compilation: "error MSB4057: The target "CreateGeneratedAssemblyInfoInputsCacheFile" does not exist in the project"
This happens because XSharp.CurrentVersion.targets now contains the following target:
<Target Condition =" '$(GenerateAssemblyInfo)' == 'True'"
Name="XsCoreGenerateAssemblyInfo"
DependsOnTargets="CreateGeneratedAssemblyInfoInputsCacheFile"
Inputs="$(GeneratedAssemblyInfoInputsCacheFile)"
Outputs="$(GeneratedAssemblyInfoFile)">
<ItemGroup>
<!-- Ensure the generated assemblyinfo file is not already part of the Compile sources, as a workaround for https://github.com/dotnet/sdk/issues/114 -->
<Compile Remove="$(GeneratedAssemblyInfoFile)" />
</ItemGroup>
<WriteCodeFragment AssemblyAttributes="@(AssemblyAttribute)" Language="$(Language)" OutputFile="$(GeneratedAssemblyInfoFile)">
<Output TaskParameter="OutputFile" ItemName="Compile" />
<Output TaskParameter="OutputFile" ItemName="FileWrites" />
</WriteCodeFragment>
</Target>
(My highlight)
For now I've just worked around the issue by adding an empty target with the name CreateGeneratedAssemblyInfoInputsCacheFile to my xsharp projects, but it would be nice to know what the idea here is, so I can figure out what might possibly be broken.
Are we expected to hit https://github.com/dotnet/sdk/blob/main ... rgets#L171 ?
I wasn't able to pinpoint anything in the whatsnew pdf that could explain this change, but I don't work in xsharp very often, so something might've gone over my head. Any input would be appreciated.
I've searched the forum for the term 'CreateGeneratedAssemblyInfoInputsCacheFile' without finding anything.
My environment:
Microsoft Visual Studio Professional 2022
Version 17.7.3
VisualStudio.17.Release/17.7.3+34024.191
Microsoft .NET Framework
Version 4.8.09032
Installed Version: Professional
Visual C++ 2022 00476-80000-00000-AA667
Microsoft Visual C++ 2022
ASP.NET and Web Tools 17.7.273.65229
ASP.NET and Web Tools
Azure App Service Tools v3.0.0 17.7.273.65229
Azure App Service Tools v3.0.0
C# Tools 4.7.0-3.23416.8+43b0b05cc4f492fd5de00f6f6717409091df8daa
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
NuGet Package Manager 6.7.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
Razor (ASP.NET Core) 17.7.3.2333001+0ab18affdf2a37647768d0e25f5f021bee6257a1
Provides languages services for ASP.NET Core Razor.
SQL Server Data Tools 17.7.10.1
Microsoft SQL Server Data Tools
TypeScript Tools 17.0.20628.2001
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 4.7.0-3.23416.8+43b0b05cc4f492fd5de00f6f6717409091df8daa
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual F# Tools 17.7.0-beta.23314.10+e612cf93b989503c89e3a5830090062b7ab5e143
Microsoft Visual F# Tools
Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.
WiX Toolset Visual Studio Extension 1.0.0.22
WiX Toolset Visual Studio Extension version 1.0.0.22
Copyright (c) .NET Foundation and contributors. All rights reserved.
X# Visual Studio Project System 2.17.0.3