Broken compatibility for assembly GetNAme() in 2.0

W

WT

Hello,


We have a license system that checks the assembly name and version using
..NETLicenseManager API (Cf Nikhil K. book on server controls) , using a
deployment project we are able to set the assmbly name and version for
resulting dll, and it works ok.
string assemblyPart = type.Assembly.GetName().Name;

string versionPart = type.Assembly.GetName().Version.ToString();


But in dev phase, our assembly name is automatically generated without
possibility of control and it is very uneasyto work with, solution should be
to put #if everywere the license is tested or the assembly name is get from
..net, but this practice doesn't allow real testing.

So what to do: something has been broken here going from 1.1 to 2.0.
What to do ?
Any idea welcome.

CS
 
W

Walter Wang [MSFT]

Hi MT,

Thank you for posting!

Regarding the code:

string assemblyPart = type.Assembly.GetName().Name;

Can you tell me where is the 'type' from? Is it from a Page class?

And I'm not quite clear about your question about "something has been
broken here going from 1.1 to 2.0". Have you tried the suggestion provided
by Ken Cox in your other post regarding this issue? BTW, the Web
Application Projects 1.0 is released just a few days ago. This new model is
ideal for web site developers who are converting a Visual Studio .Net 2003
web project to Visual Studio 2005.


Regards,

Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
W

Walter Wang [MSFT]

Hi CS,

Sorry for the typo in your name in previous post.

Regards,

Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
W

WT

Hello Walter,

No pb with typo.
Concerning the Ken Cox answer, I don't see it, I will refresh my outlook
subscription to this newsgroup.
My project is now converted to 2.0.
type is an instance of a class that resides in the App_Code folder, when I
run my web application under VS2005 debuger , I get in assemblyPart a name
like App_dzk23, each new run gives a different name.
So it is uneasy to test something.

Regards
CS
 
W

Walter Wang [MSFT]

Hi CS,

Have you tried the Web Application Projects addin? Would you mind letting
me know the result of the suggestions? If you need further assistance, feel
free to let me know. I will be more than happy to be of assistance.

Have a great day!

Regards,

Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
W

WT

Hi Walter,

Yes it solved it for final project, but in dev phase, assembly name is lost.
That's a reat problem.

CS
 
W

Walter Wang [MSFT]

Thank you for your quick response.

I've done some test using Web Application Projects add-in, but was unable
to reproduce the problem. Here's the steps I used to test it:

1) Create a new Visual C# "ASP.NET Web Application"
2) Create a new class Class1
3) In Default.aspx.cs, Page_Load:

Class c1 = new Class1();
Response.Write(c1.GetType().Assembly.GetName());

The result shows correctly the Project's assembly name.

If I use following code in Page_Load:

Response.Write(this.GetType().Assembly.GetName());

It does show an assembly name which is dynamic, but I think it's the same
behavior with ASP.NET 1.1 which is expected.

If there is anything I misunderstood, please feel free to post reply here.


Regards,

Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top