Where to specify the version number on the ASP.NET website

So, I have an ASP.NET website (as opposed to a web application) that does not have an AssemblyInfo.cs file or a Bin folder or something like that.

I want to indicate the version number of the assembly (for example, 7.0.2.0). In a web application, you do this in the AssemblyInfo.cs file.

I tried adding the Properties folder with the AssemblyInfo.cs file, but I don’t think it was picked up - because when I call Assembly.GetExecutingAssembly (). GetName (). Version.ToString () I get 0.0.0.0

So: what do I need to do to get AssemblyInfo.cs to work or how to specify the version number?

+5
source share
5 answers

K , -.

+6

dll. -, , . , - , .

+1

. , .

+1

AssemblyInfo App_Code.

0

Maybe I was a little late, but I ran into a problem, and I just created and assembled an assembly containing only the source AssemblyInfo.cs file with the attributes I needed.

Then I added the AssemblyInfo project to my solution.

And then I implemented a script to run during deployment as follows:

:: Just prepare and clean before starting
SET DOTNETINSTALLDIR=%FRAMEWORKDIR%\v4.0.30319
rmdir /S /Q "%Depot%\AssetExplorer.Web"
mkdir "%Depot%\AssetExplorer.Web"

:: Compiles the web site
call "%DOTNETINSTALLDIR%\aspnet_compiler" -f -c -u -p "%~1..\Discovery.Web" -v "/AssetExplorer" "%Depot%\AssetExplorer.Web"

:: Time to merge the contents into the assembly
call "%WindowsSDK_ExecutablePath_x86%\aspnet_merge" -o ICM.dll -a "%Depot%\AssetExplorer.Web" -copyattrs "%~1..\AssemblyInfo\obj\Release\AssemblyInfo.dll"

Magic in

-copyattrs "%~1..\AssemblyInfo\obj\Release\AssemblyInfo.dll", 

it takes the attributes from AssemblyInfo.dll and copies them to the generated assembly.

Hope it helps;)

0
source

All Articles