-
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
AssemblyInfo.fs not present in F# .NET Standard 2.0 and .NET Core 2.1 projects #5309
Comments
I just now created the first C# .NET Standard 2.0 Class Library in that solution, and I see that this project does not have AssemblyInfo.cs. This very much strengthen my suspicion that this is by design, also for F#. (I should have thought of checking this before reporting.) In other words, this is probably not an issue. |
AssemblyInfo is now auto generated - you can specify AssemblyVersion etc in your project file now. |
Slightly bad news for me, because it breaks backward compatibility with the way I've been doing stuff. I have used two common files for the entire solution. They are named SharedAssemblyInfo.cs and SharedAssemblyInfo.fs. They have been linked into all projects in the solution, and adds to the local AssemblyInfo.cs/fs. The purpose of this has been that the build script need modify only those two files in order to set the version. This I have done in order to minimize the logic needed in the build script. With .NET Framework, this worked out very well for C#, because the compiler will complain about duplicate entries, so I only had to remove duplicates from the initial AssemblyInfo.cs according to error messages. In F# not quite that well, because the compiler didn't complain about duplicates, but took the last one. I reported this in another issue here. But it works. With .NET Core I have not found a way to continue this way of doing it - having the version in a centrally located file. I get compile errors that I don't understand what to do with when I try the above. I admit I haven't yet had the time to fully investigate. (edit: I think the error message(s) complained about duplicate entries - yet there were none.) |
What are the exact errors? You could either disable automatic AssemblyInfo generation, or include a common props file in a central location which has the AssemblyVersion attribute. In fact I think you don’t even need that - just build your solution with: msbuild Foo.sln /p:AssemblyVersion=1.2.3.4 There are about three ways to skin this cat :) |
Thanks a lot. I'll try the first option for now, and the other two will both be useful in time. Since this was by design, and I no longer seem to have a problem with it, I'll close the issue. |
Ilja Nosik mentioned the possibility to disable automatic AssemblyInfo generation in another issue I also started about AssemblyInfo files. |
Found a trivial issue while migrating to .NET Standard / Core.
I have created one F# .NET Core 2.1 Console Application and several F# .NET Standard 2.0 Class Library, using Visual Studio 2017.
Problem: None of the new projects contain AssemblyInfo.fs after creation.
Is this a deliberate design decision, or something missing?
Expected behavior
AssemblyInfo.fs should be present in new projects, like we're used to with F# .NET Framework projects in VS 2017.
Other
VS 15.7.4
The text was updated successfully, but these errors were encountered: