473,383 Members | 1,818 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

How to read AssemblyInfo.cs ?

I'm using dotnetframework 1.1.
By the way, I don't know how to read the information of AssemblyInfo.cs file.
I wish to read it.

The following Example Files.

File 1: AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

[assembly: AssemblyTitle("C#")]
[assembly: AssemblyDescription("C# language")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("1.1.0.1913")]

[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]

File2 : AssemblyInfoReading.cs

using System;
using System.Reflection;

class Class1
{
public static void Main()
{
Assembly SampleAssembly;
// You must supply a valid fully qualified assembly name here.

SampleAssembly = Assembly.Load("Assembly text name, Version,
Culture, PublicKeyToken");
Type[] Types = SampleAssembly.GetTypes();
// Display all the types contained in the specified assembly.
foreach (Type oType in Types)
{
Console.WriteLine(oType.Name.ToString());
}
}
}

Compile is no error, but Runtime is an error.
How I will change this files?

Thank you.

Nov 17 '05 #1
5 36388
What is the error or Exception? What did you type to get the error?

More information please. No one will ever (well, probably not)
critisize you for supplying too much information, so give us any
information that you think is relevant.

-jeremiah

c8prog wrote:

[snip]

Compile is no error, but Runtime is an error.
How I will change this files?

Thank you.

Nov 17 '05 #2
Hi,

Have you substituted:

"Assembly text name, Version, Culture, PublicKeyToken"

for the concrete details of the DLL you want to open?

Regards - Octavio

"c8prog" <c8****@discussions.microsoft.com> escribió en el mensaje
news:C7**********************************@microsof t.com...
I'm using dotnetframework 1.1.
By the way, I don't know how to read the information of AssemblyInfo.cs
file.
I wish to read it.

The following Example Files.

File 1: AssemblyInfo.cs

using System.Reflection;
using System.Runtime.CompilerServices;

[assembly: AssemblyTitle("C#")]
[assembly: AssemblyDescription("C# language")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("1.1.0.1913")]

[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]

File2 : AssemblyInfoReading.cs

using System;
using System.Reflection;

class Class1
{
public static void Main()
{
Assembly SampleAssembly;
// You must supply a valid fully qualified assembly name here.

SampleAssembly = Assembly.Load("Assembly text name, Version,
Culture, PublicKeyToken");
Type[] Types = SampleAssembly.GetTypes();
// Display all the types contained in the specified assembly.
foreach (Type oType in Types)
{
Console.WriteLine(oType.Name.ToString());
}
}
}

Compile is no error, but Runtime is an error.
How I will change this files?

Thank you.

Nov 17 '05 #3
I want to compile this files without *.DLL.

I Compiled in command prompt
=> csc AssembyInfoReading.cs AssemblyInfo.cs

Run in command prompt
=> AssemblyInfoReading

Error Message
=>
Microsoft (R) Common Language Runtime Test Debugger Shell Version 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

(cordbg) a 0xb30
Process 2864/0xb30 created.
Warning: couldn't load symbols for
c:\windows\microsoft.net\framework\v1.1.4322\
mscorlib.dll
Warning: couldn't load symbols for
E:\Prg\DotNet\C#\Console\AssemblyInfoReading.
exe
[thread 0x5cc] Thread created.
Unable to determine existence of prolog, if any
[thread 0x248] Thread created.
[thread 0x5cc] Unhandled exception generated: (0x04bc3630)
<System.IO.FileNotFou
ndException>
_fileName=(0x04bc2ee0) "Assembly text name"
_fusionLog=(0x04bc2f18) "=== Pre-bind state information ===
LOG: DisplayName = Assembly text name
(Partial)
LOG: Appbase = E:\Prg\DotNet\C#\Console\
LOG: Initial PrivatePath = NULL
Calling assembly : AssemblyInfoReading, Version=1.1.0.1913, Culture=neutral,
Pub
licKeyToken=null.
===

LOG: Application configuration file does not exist.
LOG: Policy not being applied to reference at this time (private, custom,
partia
l, or location-based assembly bind).
LOG: Post-policy reference: Assembly text name
LOG: Attempting download of new URL
file:///E:/Prg/DotNet/C#/Console/Assembly te
xt name.DLL.
LOG: Attempting download of new URL
file:///E:/Prg/DotNet/C#/Console/Assembly te
xt name/Assembly text name.DLL.
LOG: Attempting download of new URL
file:///E:/Prg/DotNet/C#/Console/Assembly te
xt name.EXE.
LOG: Attempting download of new URL
file:///E:/Prg/DotNet/C#/Console/Assembly te
xt name/Assembly text name.EXE.
"
_className=<null>
_exceptionMethod=<null>
_exceptionMethodString=<null>
_message=(0x04bc3d2c) "not found file or assembly name Assembly text name
~ "
_innerException=<null>
_helpURL=<null>
_stackTrace=(0x04bc3dd0) array with dims=[60]
_stackTraceString=<null>
_remoteStackTraceString=<null>
_remoteStackIndex=0x00000000
_HResult=0x80070002
_source=<null>
_xptrs=0x00000000
_xcode=0xe0434f4d

Thread 0x5cc R 0x00000000: <unknown>
(cordbg)

Thank you.
Nov 17 '05 #4
I want to read 'C#' in [assembly: AssemblyTitle("C#")].
I want to read 'C# language' in [assembly: AssemblyDescription("C#
language")].

But I don't know how to read this attributes.

Nov 17 '05 #5
=?Utf-8?B?Yzhwcm9n?= <c8****@discussions.microsoft.com> wrote in
news:C7**********************************@microsof t.com:
I'm using dotnetframework 1.1.
By the way, I don't know how to read the information of
AssemblyInfo.cs file. I wish to read it.

using System;
using System.Reflection;

[assembly: AssemblyTitle("C#")]
[assembly: AssemblyDescription("C# Language")]

namespace AttributeExample
{
public class Program
{
public static void Main()
{
Assembly SampleAssembly = Assembly.Load(Assembly.GetExecutingAssembly().Full Name);

foreach (Attribute a in SampleAssembly.GetCustomAttributes(true))
{
if (a is AssemblyTitleAttribute)
Console.WriteLine("Assembly Title: " + (a as AssemblyTitleAttribute).Title);

if (a is AssemblyDescriptionAttribute)
Console.WriteLine("Assembly Description: " + (a as AssemblyDescriptionAttribute).Description);
}
}
}
}
--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Robert Scheer | last post by:
Hi. I tried to compile a windows forms app without the assemblyinfo.vb file, and it compiled ok. So, if I delete the assemblyinfo.vb file from my project what kinds of problems would I have? ...
2
by: MrNobody | last post by:
I'm trying to figure out how to handle versioning for my app when I found a web site talking about AssemblyInfo.cs. They say all new .NET projects get this file and it comes with automated...
0
by: Van Tumour | last post by:
I have a basic Windows Form Application (.NET) using VS2003 and C++. I modify AssemblyInfo.cpp so the appropriate line now reads: ; In my application I use the following code: ...
5
by: David | last post by:
Hello, I really need help. I use C++ VisualStudio.net version 2002. I tried to create a very simple console app. However, it won't compile, then I found out that I am missing two important...
4
by: Jeff Ptak | last post by:
Hey all, Can anyone show me the proper C# syntax necessary to read the attribute fields from the AssemblyInfo.cs file? I have the following in VB.Net, but so far am unsuccessful in translating...
7
by: Martin Bischoff | last post by:
How can I set the assembly version in an ASP.NET 2.0 project? I have added a file AssemblyInfo.cs containing the version number to my project's App_Code folder. When I try to read the version...
1
by: Oenone | last post by:
In all the projects I have upgraded from VS2003 to VS2005, the AssemblyInfo.vb file appears as a normal source file in the Solution Explorer (just as it did in VS2003). In new projects created...
2
by: James Wong | last post by:
Hi everybody, I would like to know how to retrieve information from AssemblyInfo.vb inside web service. I've tried many different ways including GetExecutingAssembly or similar method but all...
0
by: The Coder | last post by:
I get a version tab in the shell only for VS_VERSION_INFO. I was expecting AssemblyInfo.cpp to create the version tab . Can I get AssemblyInfo.cpp to create version tab instead? If can not get...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.