Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add assembly info to PrecompiledViews dll generated by dot net core 2.0

views in my .net core 2.0 project is getting generated in PrecompiledViews dll.

https://docs.microsoft.com/en-us/aspnet/core/mvc/views/view-compilation?tabs=aspnetcore2x

How to add the assembly info to this dll, information such as company name, copyrights etc.

like image 803
shyam_ Avatar asked Mar 29 '18 06:03

shyam_


People also ask

How to define assembly in c#?

An assembly is a file that is automatically generated by the compiler upon successful compilation of every . NET application. It can be either a Dynamic Link Library or an executable file. It is generated only once for an application and upon each subsequent compilation the assembly gets updated.

How assemblies data is stored in. net?

Static assemblies are stored on disk in portable executable (PE) files. Static assemblies can include interfaces, classes, and resources like bitmaps, JPEG files, and other resource files. You can also create dynamic assemblies, which are run directly from memory and aren't saved to disk before execution.

Which one is part of dot net assembly?

NET, when we compile our source code then assembly gets generated in Visual Studio. Assembly consists of two parts Manifest and IL(Intermediate Language). Manifest contains assembly metadata means assembly's version requirements, security identity, names and hashes of all files that make up the assembly.


1 Answers

You need to modified project file. like below. Able to see version information on DLL. Hope this will help you.

Note : Just publish on local, did not test the publish on server.

<PropertyGroup Label="Assembly">
  <AssemblyName>HegicMvc_Poc.PrecompiledViews</AssemblyName>
  <PackageId>Library</PackageId>
  <Product>Library</Product>
  <Authors>StackOverflow Answer</Authors>
  <Company>Test</Company>
  <Description>Library</Description>
  <Copyright>Copyright © 2016 - 2017 Test</Copyright>
  <Version>2.0.0</Version>
  <AssemblyVersion>1.0.0</AssemblyVersion>
  <FileVersion>1.0.0</FileVersion>
</PropertyGroup>

Before publish Before publish

After publish

After publish

like image 79
Parth Akbari Avatar answered Nov 15 '22 04:11

Parth Akbari