From what I can tell and what I have read, a #Const only relates to the Class in which it was declared. Is there any way to do something like this globally? Any ideas on possible ways to extend it globally?
Aha. I had just checked my 2003 Enterprise Architect version and it was available there. It appears that this is something else that they left out of the Express version. I guess it is time to buy a full version of Visual Studio 2005.
Any chance you can see those values declared in your AssemblyInfo file or somewhere like that? At least I could try to force my values into the source file behind that screen.
they are stored in the vbproj file, so I would THINK you should be able to edit your vbproj file manually to include any conditional compile constant you want.
it is under a node for <PropertyGroup> here is the node from the vbproj file where I made my screen shots for you
He is what I have found... There are 2 configuration sections in my 2005 Express vbproj file (this was an upgraded project from 2003, so that may explain the 2nd configuration section). However, 2005 only operates off of the <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> section. If I put values in there, they DO show up with intelisense when I type #If.
This doesn't make changing these values very easy, but at least I can limp along for right now.
No. A friend just sent me a screenshot of the Compile tab from his version and Express doesn't have any of the Configuration Modes available. (I would send a screenshot, but don't any site space easily available to put it on.)
You probably cannot run both, but you could run Virtual PC and install it there.
PS - You have to stop answering all of my questions. The system will not allow me to make any more adjustments to your reputation until I give reputation to other people.
It's ok.. I was on this forum long before reputation points where turned on
Hey, you know you can post screen shots right on here don't you?
All you need to do is take your screen shot, paste it in mspaint (save it as a jpg because bmp will be big, unless you need all the color that bmp has over jpg)
then just attach it. If you are doing a quick reply, click "Go Advanced" to get the option to add an attachment.
If you only upload a single image file, then it will automatically be displayed in your forum post. If you do more than one (like I did above) then you have to first post it, then you can edit your post and wrap the links to your attachments in [img] tags...
I can use Debug and Release, now. But I was only using Release apparently, which did everything fine for me. And, it will let me use the Constants in there. I just have to edit the vbproj file manually. It's isn't great, but it works.
Any chance that there is a way to conditionally set the Assembly Name and Application Icon?
This application will be put into two different office locations. The home office will need to be able to run both applications, so it would be nice to name them a little differently and to have a different icon.
I haven't found such a mechanism, so I may just write another app that makes the changes to the VBPROJ file.
The Express version does give me the ability to set different "Configurations". I created 2 new configurations, one specific to each office and then editted the VBPROJ file to add <AssemblyName> and <ApplicationIcon> nodes to the XML there. It appears to work fine.
The only problem that I have seen with it is that when I "Publish" the application, it is going to give a different build number to each office. That isn't perfect, but it will work for me.
Just a note in case someone else tries to force the Publish to do what they want. Here is what I have learned so far. I am going to post the relevant VBPROJ file pieces and then explain below.
Note: The four lines of code under each Configuration section are lines that I added to the VBPROJ file manually.
Legend:
1 - The AssemblyName works for the BUILD but not for the PUBLISH. Let me elaborate a little. If the Release-City1 configuration is selected, the Build works great and uses the AssemblyName and ApplicationIcon values from the Configuration settings that I added to the VBPROJ file. However, when you Publish the application, the Build works and then you get an error with the Publishing stating that it cannot find a folder. What appears to be happening is that the compiler uses the Configuration settings to build the application and stage its files, but when the Publish section starts, it ignores all of the values in the Configuration settings. Per the example above the Build creates a folder \bin\MyApp - City1.Publish and puts the necessary files in there then the Publish starts and is looking for a folder \bin\MyApp.Publish.
2 - The ApplicationIcon can be set in the appropriate PropertyGroup and it will work. (I forced this value into the VBPROJ file and it worked.)
3 - The PublishUrl value only works from the main PropertyGroup. It does not work from within the various configuration PropertyGroups.
4 - The ProductName value only works from the main PropertyGroup. It does not work from within the various configuration PropertyGroups. (This is the Product Name displayed on the ClickOnce Publish.htm page.)
5 - The PublisherName value only works from the main PropertyGroup. It does not work from within the various configuration PropertyGroups. (This is the name given to the folder in the Start -> All Programs menu)
In conclusion, from what I can garner about the process, it appears that the Build process will use the Configuration settings, but the Publish ignores them. This creates the error during the Publish.
Assumedly, the Publish portion of the Build process creates the Publish.htm and MyApp_ver_ver_ver_ver.application files, as those two files do not exist in the \bin\MyApp - City1.Publish folder.