Is it possible to set the OriginalFilename property for a .Net assembly with Visual Studio?
My understanding (which may well be faulty) is开发者_StackOverflow that it is easy to set the OriginalFilename property for a C++ DLL or EXE by including a VERSIONINFO resource file in the Visual Studio build.
But I can't find any way of setting OriginalFilename for a C# build. It is apparently always set to the name of the output file being built.
I'd really like to be able to specify this if possible. Any ideas? Thanks.
OK, no answers, and now I've found a workaround.
This article here at StackOverflow was very helpful: How do I set the version information for an existing .exe, .dll?
Which led me to this resource manipulation project written in C#: http://resourcelib.codeplex.com/
So what I'm going to do is to modify the DLLs after they've been built.
Edit (March 2015): This is an old posting, but I can see there is still some interest in it. The "ResourceLib C# File Resource Management Library" open source project has moved since four years ago, and is now here: https://github.com/dblock/resourcelib
Yes it is possible to set it, -> right-click on the project or assembly name in visual studio -> select properties -> select Application tab -> change the assembly name as you want.
Please refer the link to view property window, in which assembly name option is there
After changing the name compile the project,(to verify the change) right click your compiled DLL file and select properties and click on 'Details' tab, in which you can see the 'original filename' is now changed.
Sadly, no.
You can read what it is with System.Diagnostics.FileVersionInfo.OriginalFilename
, but the value is filled by the Project / Output Filename
not from any Assembly Attribute.
Running your patch program to change it after a build runs the risk of breaking any digital signature applied during the build. You may need to build without signing, patch the attributes, then sign it in a separate step.
精彩评论