PC Review


Reply
Thread Tools Rate Thread

Setting an Assembly Attribute with an Environment Variable

 
 
rosenfeld1@walla.co.il
Guest
Posts: n/a
 
      23rd May 2005
I have a question regarding .NET C# programming. Is there a way to set
an assembly attribute in an AssemblyInfo.cs file using a preset Windows
Environment Variable?
The problem is that the AssemblyAtribute requires a CONST string and
the Environment Variable is only linked during run time.

i.e.

public class DelaySignFile
{
public string strFilePath;
DelaySignFile()
{
strFilePath = Environment.GetEnvironmentVariable("OutDirCommon");
}
}

[assembly: AssemblyKeyFile(DelaySignFile.strFilePath)];


Thanks,
Avi

 
Reply With Quote
 
 
 
 
Mattias Sjögren
Guest
Posts: n/a
 
      23rd May 2005

>Is there a way to set
>an assembly attribute in an AssemblyInfo.cs file using a preset Windows
>Environment Variable?


No, but you can write a tool that reads the environment variable and
writes the appropriate attribute to a source file, and then run it as
a pre-build tool.



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
 
Reply With Quote
 
rosenfeld1@walla.co.il
Guest
Posts: n/a
 
      25th May 2005
Thanks for the answer.
The point is that I'd like to link the same AssemblyInfo.cs file (Which
has that DelaySign assembly attribute) to some projects.
If I'll use the pre-build tool then I'll need to run it when compiling
each project separately (In other words, I'll need to include that
pre-build file in each project). Is there a way to avoid that?

Thanks,
Avi

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
path environment variable assembly Eric Bentley Windows XP Security 0 30th Dec 2010 06:42 PM
Setting up a environment variable in citrix viv7 Microsoft Windows 2000 4 12th May 2006 08:56 AM
Setting an environment variable beaker Microsoft VB .NET 1 19th Oct 2005 05:45 PM
Setting an Environment Variable Paul Bergson Microsoft Windows 2000 Group Policy 0 15th Dec 2004 03:06 PM
setting an environment variable via the output of a command Timothy Stone Windows XP Basics 1 13th Jan 2004 02:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:33 PM.