Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-15-2004, 11:13 AM
jfreedman jfreedman is online now
Registered User
 
Join Date: 10-15-2004
Posts: 12
Setting AssemblyKeyFileAttribute property in assemblyinfo.vb

Hi there,

Currently Evaluating Visual Build and I'm trying to figure out a few things. In general what do people think of this product?

Main question...

When I add a Make VS.NET action, under the properties tab I can modify several assemblyinfo properties, but I don't seem to have access to the "AssemblyKeyFileAttribute" property.

When our build happens, I would like to make sure this property is always set, so our object will be strong named. Is there anyway to do this in Visual Build Pro?

Thanks!
Reply With Quote
  #2  
Old 10-15-2004, 01:24 PM
kevina kevina is online now
Registered User
 
Join Date: 03-27-2003
Posts: 825
No direct way currently exists in Visual Build Professional to update that particular entry in the AssemblyInfo property from a Make VS.Net action.

You can fairly easily modify the AssemblyInfo file directly using a Replace In File step and a Write File step, see the attached example that demonstrates this.
Attached Files
File Type: bld replace attributekeyfileattribute value.bld (1.1 KB, 1576 views)
Reply With Quote
  #3  
Old 10-17-2004, 04:09 PM
pjaquiery pjaquiery is online now
Registered User
 
Join Date: 01-20-2003
Location: Dunedin, New Zealand
Posts: 114
In general Visual Build Pro. is an excellent product and the support is the best I have ever seen anywhere!

There are a few traps when you are getting started, particuarly to do with inline script. But the power that you get as compensation is much more than worth the pain.

If you need any sort of build management or similar system then VBP is it.

Peter Jaquiery
Reply With Quote
  #4  
Old 10-18-2004, 03:55 PM
jfreedman jfreedman is online now
Registered User
 
Join Date: 10-15-2004
Posts: 12
No replacements made in file message

Let me rephrase my post I earlier deleted...


I am assuming (based on my tests) that in the replace action, if the item we are searching for to replace already equals what it should replace, I get a message of "No replacements made in file"

The next action which then adds to the file will add the property if the last action returned "No replacements made in file".

So in my instance, if the property is already set correctly, the first action returns "No replacements made in file", the next action then says if the prior action returned "No replacements made in file", then to add text to it. This would cause the property to get written out a second time.

How do I prohibit it being written out on the second action if the first action returned "No replacements made in file" because the property was already there?

Thx
Reply With Quote
  #5  
Old 10-18-2004, 06:00 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
As you discovered, the test in the above example isn't foolproof because the Replace in File action only modifies the file (and logs such action) if the replacement value(s) would change the file contents. The attached updated sample uses a conditional build rule that checks the file for the existence of that attribute instead.

Also, the next release of VBP will include enhancements to the Replace in File action, including storing temporary macros for the match count and replacement count, allowing the match count to be checked in this situation.
Attached Files
File Type: bld repl_keyfileattr.bld (1.4 KB, 1484 views)
Reply With Quote
  #6  
Old 10-19-2004, 08:51 AM
jfreedman jfreedman is online now
Registered User
 
Join Date: 10-15-2004
Posts: 12
Steps?

I took a look at the new sample but there don't seem to be any project steps in it. Am I missing something here?

Thx
Reply With Quote
  #7  
Old 10-19-2004, 09:32 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Hmmm. Must have been a hiccup in the forum upload. The attachment should be non-empty now.
Reply With Quote
  #8  
Old 10-19-2004, 01:24 PM
jfreedman jfreedman is online now
Registered User
 
Join Date: 10-15-2004
Posts: 12
RegEx being evaluated incorrectly

Another question for ya...

I have setup a Macro variable called VersionNumber, its value is 3.2.3.0

In my replace action, I tell it to replace with the following...

$2%VersionNumber%$4

Which would evaluate to $23.2.3.0$4

It believes I want to replace with a "$23" instead of "$2", since the first char in my variable is a 3

How do I keep this from happening so it evaluates to the $2 only?

Thx again for the help.
Reply With Quote
  #9  
Old 10-19-2004, 01:29 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Use $2(%ASSEMBLYKEYFILEATTRIBUTE%)$4
Reply With Quote
  #10  
Old 10-19-2004, 02:30 PM
jfreedman jfreedman is online now
Registered User
 
Join Date: 10-15-2004
Posts: 12
Write file conditional statement not working?

Hello one more time,

I tried running the repl_keyfileattr.bld project. I run all 3 steps the first time, and the assemblyinfo data gets inserted.

If I then run only step 3 again, which should only write out the info if it isn't found, it still writes it out a second time even though the data already exists.

The instr that is defined in the writefile action looks correct, I'm not sure why it is returning a false value and making the action kick off.

Thx
Reply With Quote
  #11  
Old 10-19-2004, 02:51 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Possibly this:
http://www.kinook.com/Forum/showthread.php?threadid=228
http://www.kinook.com/Forum/showthread.php?threadid=240
Reply With Quote
  #12  
Old 10-19-2004, 03:34 PM
jfreedman jfreedman is online now
Registered User
 
Join Date: 10-15-2004
Posts: 12
thx

Thanks,

That was it.
Reply With Quote
Reply


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 Off
HTML code is Off



All times are GMT -5. The time now is 01:50 PM.


Copyright © 1999-2023 Kinook Software, Inc.