error MSB4057: The target "CreateGeneratedAssemblyInfoInputsCacheFile" does not exist in the project

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
Post Reply
User avatar
knutdrofus
Posts: 7
Joined: Fri Dec 13, 2019 10:11 am

error MSB4057: The target "CreateGeneratedAssemblyInfoInputsCacheFile" does not exist in the project

Post by knutdrofus »

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
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: error MSB4057: The target "CreateGeneratedAssemblyInfoInputsCacheFile" does not exist in the project

Post by robert »

Knut,
This code is executed when you set the property <GenerateAssemblyInfo> to true in your project file.
This particular code in our build system is normally used when building for .Net Core/5/6/7. I do not think this is supported for .Net Framework.
Does your project file, or any of the imports, contain this property?

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
knutdrofus
Posts: 7
Joined: Fri Dec 13, 2019 10:11 am

Re: error MSB4057: The target "CreateGeneratedAssemblyInfoInputsCacheFile" does not exist in the project

Post by knutdrofus »

Thanks for the quick reply.

Yes, it seems to be. We are indeed using .net framework here, so this would explain it. We have a props file that is used when compiling both c# and xsharp projects, and it does set GenerateAssemblyInfo to true. I tried making it conditional and only apply to non xsharp projects, and that did seem to fix the problem.

Just so I understand: GenerateAssemblyInfo has never worked for when building for .net framework, it just didn't cause compilation issues before.

I'll do some more testing and discuss with some colleagues tomorrow, but this does seem to answer the question.
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: error MSB4057: The target "CreateGeneratedAssemblyInfoInputsCacheFile" does not exist in the project

Post by robert »

Knut,
I will check to see if I can make this target in our build support file only work in SDK builds and not in Framework builds.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: error MSB4057: The target "CreateGeneratedAssemblyInfoInputsCacheFile" does not exist in the project

Post by robert »

Knut,
Fixed in X# 2.18
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply