Versioning C# ASP.NET Web Service (ASMX)

Julio Bello 221 Reputation points
2021-12-19T04:03:22.077+00:00

Hi, Everybody!...

All I want to do is to version my C# ASP.NET web service (ASMX). It is built upon C# ASP.NET web site .NET 4.7.2.

I have read MANY articles on the subject matter. All are either (a) too complicated, (b) lack specific detailed information or (c) not applicable to my case. All I want is a SIMPLE, STEP-BY-STEP procedure APPLICABLE to my case. Remember, I have an C# ASP.NET web service (ASMX), built upon C# ASP.NET web site .NET 4.7.2. Please do not advise me about WCF and/or ASP.NET Core.

The following article is the closest to what I need to know.

How to: Create Versioned Assemblies for Precompiled Web Sites

However, it neglects to tell me the following information...

  • How to determine a specific GUID for the ID of the typelib of my project if I were to expose it to COM.
  • Where to place the assembly-information file. It advises not to place the assembly-information file in the App_Code directory.

Can anyone please help me with these last two points?

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,254 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,248 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,021 Reputation points
    2021-12-19T17:16:33.483+00:00

    A precompiled asp.net site is not a com dll. Not sure if the aspnet_compiler supports this, but if you want to com support, you define the guild and interfaces in your code. See

    https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/interop/example-com-class

    The App_Code folder is special. It contain source code that is only compiled when the website is started. So you never add precompile code, because it would be like adding the same code twice to the project. You can literally add the code anywhere else. It just a file with the version number.

    using System.Reflection;  
    using System.Runtime.InteropServices;  
      
    [assembly:System.Reflection.AssemblyVersionAttribute("1.0.0.0")]  
      
    

    As the doc indicates you add the path to the file with a page directive, or the web.config used for the precompile.

    What part of the precompile docs do you not understand? Basically you just run the aspnet_compiler to produce the dll.

    Not sure what you are trying to accomplish. Maybe if you explained your requirements it might help.