netcorecli-fsc icon indicating copy to clipboard operation
netcorecli-fsc copied to clipboard

assemblyinfo attributes are not generated from fsproj

Open enricosada opened this issue 7 years ago • 2 comments

ref https://github.com/GoogleCloudPlatform/google-cloud-dotnet/issues/863

Attributes like TargetFrameworkAttribute, Version, FileVersion should be auto generated as temporary AssemblyInfo.fs passed to compiler

that's a regression from .net core sdk preview2

atm is not implemented at all.

As a workaround, these can be manually generated. From https://github.com/GoogleCloudPlatform/google-cloud-dotnet/issues/863#issuecomment-285860239, create a new source file (file name doesnt matter)

namespace System

[<assembly:System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v1.1")>]
do ()

and add it as Compile item, like <Compile Include="AssemblyInfo.fs" />

enricosada avatar Mar 12 '17 16:03 enricosada

how to fix it: we need to implement F# support in WriteCodeFragment tasks https://github.com/Microsoft/msbuild/blob/master/src/Tasks/WriteCodeFragment.cs

is just a foreach over assemblyattributes, in the switch (for coreclr), like c# does, no codedom needed

Same file for msbuild full codegen

/cc @brettfo @KevinRansom

enricosada avatar Mar 29 '17 15:03 enricosada

How were these attributes getting created before?

@baronfel--just trying to see how necessary it is to bake support for every language into core MSBuild tasks.

rainersigwald avatar May 04 '17 22:05 rainersigwald