-
Notifications
You must be signed in to change notification settings - Fork 789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate F# assemblyinfo in new fsproj #3113
Comments
To do this for the SDK we can override in our targets file and sdk apps will work fine. But we should also send a PR to the dotnet sdk refactoring the current implementation a bit. thanks for pushing on this, it's really great that you take the time to dive into all of the stuff. |
Yes, didnt know a refactoring effort was needed or ongoing, but is getting better. love to override only what's needed 👍 Let's wait a bit for new @dasMulli PR ( from dotnet/msbuild#2132 (comment) ) seems that refactoring is in progress already
Meanwhile i'll prepare a task to write the file to be added in So as your said we'll need to just override |
Actually I was referring to the dotnet sdk rather than an msbuild refactoring. And it’s only a tiny refactor just enough to get the attributes separate from what we need to implement in an override.
|
@KevinRansom yes @dasMulli is doing that with dotnet/sdk#1255
The we will override just |
Should now do the trick, the |
@enricosada @KevinRansom Where are we with this - does it have to be done for the SDK work to count as feature complete? thx |
@enricosada @KevinRansom ping... (I'm trying to clarify the status of all the "Urgency Now" bugs) |
@dsyme i half finished it, i hope one or two days |
I recently found SuaveIO/suave#635 (assembly version should be 2.1.1.0 but is coming out as 0.0.0.0 when built with the dotnet core CLI tools -- when built with the .Net Framework tools or the Mono tools the assembly version is correct). At first I thought that was caused by an incorrect build step in the Suave project. But could that bug possibly be getting caused by this one? If the project is specifying the assembly version, but it's not making it into the DLL because of this bug, that would also explain the symptoms I'm seeing. I'm completely lost when it comes to the .NET Core build system at the moment -- too many changes that I haven't been able to find documentation for -- so it's entirely possible that I'm barking up the wrong tree. But the fact that this bug is still open does make me wonder... |
@enricosada @KevinRansom ping... (I'm trying to clarify the status of all the "Urgency Now" bugs) |
@dsyme @enricosada @KevinRansom Thank you guys for working on this one! happy to that I'm not the only one who have spotted it 😉 I'd say that this is very important (or even critical) issue as it breaks unification between C# and F#. Our solution contains both Is there any chance that this issue will be resolved in the nearby future, so build scripts could be much simplified? |
@zvirja yeah ... sorry about this ... it slipped through the cracks. |
@enricosada, let me know if you want me to take care of this. |
In a .NET Core 2.0 console app, I've set the assembly version in the project properties, but when building with VS, the version is always missing ( I'm currently working around this by explicitly adding [<assembly: System.Reflection.AssemblyVersionAttribute("2.0.0.0")>] |
@cmeeren Yep, that's because of this issue. @dsyme @KevinRansom Do you know if it will be fixed somewhere soon? The VS 2017 update 5 did a great step towards the unification, while this issue still makes us to feel the difference between different SDKs.. 😕 |
I have been struggling with this issue for days not getting the assembly info attributes in my compiled .dlls for F# projects. Will this be fixed? I'm running dotnet cli 2.1.3. Guess I'll have to do it the F# ProjectScaffold style for now. |
I'm doing this in my build script for now
|
Hmm..seems that using the ProjectScaffold FAKE script's AssemblyInfo step does not work when building F# projects with dotnet CLI either. |
Registering my interest here, too, from #3549 (comment) |
This seems to be fixed in VS 2019. |
Fixed as in a file is generated with new projects or fixed as in the contents of the Assemblyinfo file (version, icon, etc) are properly handled? |
@atlemann It was reported above that building within Visual Studio fixes the problem. The problem only happens in the dotnet-core runtime based compiler. Visual Studio runs the full-framework based one. (At least that was the state in VS2017) |
@matthid You're right. .NET Core SDK: 2.2.204 Using Building the same project using VS2019: |
@ there is an issue with the coreclr compiler, that it generates the attributes fine, however, it doesn't embed them as a resource in the resource fork. This is a known limitation of the F# compiler for coreclr, it is a fair sized amount of work to make it work and so it will be addressed when priorities allow. Kevin |
@atlemann can you try a 3.0 preview CLI (even when building for < 3.0)? The new build tasks in the CLI copy over resources from the dll file to the apphost executable when building on windows machines. |
@dasMulli I believe the issue is that the dll won't have the resources in the first place when compiled with the F# compiler running on .NET Core. |
@dasMulli I still see this issue in I also wanted to note that passing in version as a property does not work either: |
…nto the codebase
I've sent a PR for this, so I hope we can finally get this sorted out. I understand this has low priority but it disturbs me every time I see it and makes it harder for people - especially for newcomers - to figure out version related issues... I have seen this several times |
So the FileVersion thingy still needs to be fixed if I understand correctly? |
I commented on the PR: #7024 (comment) It seems there's a misunderstanding about work for managed resources becoming useful for this problem when they are actually separate. |
This might be affecting #7220 |
…nto the codebase (dotnet#7024)
new fsproj should generate assemblyinfo attributes from props.
ref dotnet/netcorecli-fsc#93
dotnet/sdk
is done in the language agnostic target Microsoft.NET.GenerateAssemblyInfo.targets#L93-L96 using theWriteCodeFragment
taskWriteCodeFragment
is defined inside Microsoft/msbuild and contains a version with CodeDom and another for coreclr (just doing stringbuilder), and support both c# and vbAs a note i tried to add the F# in the same way as C#/VB, but atm PR was stopped for a design decision
dotnet/msbuild#2132 (comment) /cc @KevinRansom @cartermp
The text was updated successfully, but these errors were encountered: