# Vb.Net Repository #IF

**URL:** https://forum.alternetsoft.com/t/vb-net-repository-if/425
**Category:** AlterNET Studio Support
**Tags:** editor
**Created:** [October 12, 2023, 1:06pm UTC](https://forum.alternetsoft.com/t/vb-net-repository-if/425 "2023-10-12T13:06:15Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![rob.panosh](https://forum.alternetsoft.com/letter_avatar_proxy/v4/letter/r/606060/32.png) [@rob.panosh](https://forum.alternetsoft.com/u/rob.panosh)
#### Post date: [October 12, 2023, 1:06pm UTC](https://forum.alternetsoft.com/t/vb-net-repository-if/425/1 "2023-10-12T13:06:15Z")

</div>

Hi,

How do I register custom constants so they show up in intellisense with #IF ?

 ![image](https://forum.alternetsoft.com/uploads/default/original/1X/789dfa8051307167bd8508e2a8bed0902969b14b.png)

Thanks,  
Rob

---

<div class="post-metadata">

### Author: ![dmitry.medvedev](https://forum.alternetsoft.com/user_avatar/forum.alternetsoft.com/dmitry.medvedev/32/27_2.png) [@dmitry.medvedev](https://forum.alternetsoft.com/u/dmitry.medvedev)
#### Post date: [October 18, 2023, 10:55am UTC](https://forum.alternetsoft.com/t/vb-net-repository-if/425/2 "2023-10-18T10:55:52Z")

</div>

Hi Rob,

Roslyn parser shows conditional defines that are defined on a project level.

Here’s sample code :

```auto
var solution = VbSolution.DefaultSolution;
solution.SetProjectConditionals(new string[] { "DEBUG=TRUE", "MYCONST=1"}, solution.ProjectId);

```

These constants will be shown in the intellisense for #if/#elseif

 ![image](https://forum.alternetsoft.com/uploads/default/original/1X/f8d846acef1084864ea284d0a2a4c254c341a241.png)

Regards,  
Dmitry

---

<div class="post-metadata">

### Author: ![rob.panosh](https://forum.alternetsoft.com/letter_avatar_proxy/v4/letter/r/606060/32.png) [@rob.panosh](https://forum.alternetsoft.com/u/rob.panosh)
#### Post date: [March 13, 2024, 4:36pm UTC](https://forum.alternetsoft.com/t/vb-net-repository-if/425/3 "2024-03-13T16:36:13Z")

</div>

Hi Dmitry,

I tried this and I am getting the following error.  
 ![image](https://forum.alternetsoft.com/uploads/default/original/1X/c5ca885db04e36243d3c8f7a54548ccb0c7dd2f4.png)

---

<div class="post-metadata">

### Author: ![dmitry.medvedev](https://forum.alternetsoft.com/user_avatar/forum.alternetsoft.com/dmitry.medvedev/32/27_2.png) [@dmitry.medvedev](https://forum.alternetsoft.com/u/dmitry.medvedev)
#### Post date: [March 17, 2024, 10:52am UTC](https://forum.alternetsoft.com/t/vb-net-repository-if/425/4 "2024-03-17T10:52:10Z")

</div>

Hi Rob,

Thank you for reporting this problem,

It looks like this works:  
` solution.SetProjectConditionals(new string[] {"MYCONST"}`  
however, this does not:  
` solution.SetProjectConditionals(new string[] {"MYCONST=1"}`  
We will fix it shortly.

Kind regards,  
Dmitry

---

<div class="post-metadata">

### Author: ![rob.panosh](https://forum.alternetsoft.com/letter_avatar_proxy/v4/letter/r/606060/32.png) [@rob.panosh](https://forum.alternetsoft.com/u/rob.panosh)
#### Post date: [March 18, 2024, 12:46pm UTC](https://forum.alternetsoft.com/t/vb-net-repository-if/425/5 "2024-03-18T12:46:26Z")

</div>

Thanks Dmitry, quick question. Why do we need to add =1?

Rob

---

<div class="post-metadata">

### Author: ![dmitry.medvedev](https://forum.alternetsoft.com/user_avatar/forum.alternetsoft.com/dmitry.medvedev/32/27_2.png) [@dmitry.medvedev](https://forum.alternetsoft.com/u/dmitry.medvedev)
#### Post date: [March 21, 2024, 10:23am UTC](https://forum.alternetsoft.com/t/vb-net-repository-if/425/6 "2024-03-21T10:23:10Z")

</div>

Hi Rob,

We’ve just pushed a new version (9.5.3) to [NuGet](https://www.nuget.org/profiles/Alternet), where this issue should be fixed.

Visual Basic supports conditional symbols in the form Name=Value, where Value is optional.  
Value can be numeric/boolean/string. If no value is specified, the parser evaluates the conditional symbol as true if it’s set via ProjectConditionals.

Kind regards,  
Dmitry

---

<div class="post-metadata">

### Author: ![rob.panosh](https://forum.alternetsoft.com/letter_avatar_proxy/v4/letter/r/606060/32.png) [@rob.panosh](https://forum.alternetsoft.com/u/rob.panosh)
#### Post date: [March 21, 2024, 12:36pm UTC](https://forum.alternetsoft.com/t/vb-net-repository-if/425/7 "2024-03-21T12:36:18Z")

</div>

Dmitry, thanks for the update and clarifying.

Rob
