#1
|
|||
|
|||
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! |
#2
|
|||
|
|||
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. |
#3
|
|||
|
|||
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 |
#4
|
|||
|
|||
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 |
#5
|
|||
|
|||
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. |
#6
|
|||
|
|||
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 |
#7
|
|||
|
|||
Hmmm. Must have been a hiccup in the forum upload. The attachment should be non-empty now.
|
#8
|
|||
|
|||
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. |
#9
|
|||
|
|||
Use $2(%ASSEMBLYKEYFILEATTRIBUTE%)$4
|
#10
|
|||
|
|||
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 |
#11
|
|||
|
|||
#12
|
|||
|
|||
thx
Thanks,
That was it. |
Thread Tools | |
Display Modes | Rate This Thread |
|
|