Re: Option Strict Off/On



Actually you should be already able to dot that by updating your VS.NET
templates i.e. when you create a file it actually copies a template. Upading
this template should do the job...

This is not exactly the same as you wouldn't be able anymore to change this
globally on the fly. IMO the best option would be to find out if VS really
sometimes change this by itself and if yes, to fix this behavior...

--
Patrice


"Michael D. Ober" <obermd.@.alum.mit.edu.nospam.> a écrit dans le message de
news: 13pjn90hue4ifa7@xxxxxxxxxxxxxxxxxxxxx
"Linda Liu[MSFT]" <v-lliu@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:8tvpK4yXIHA.4200@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi Greg,

There're two levels of settings for VB projects.

On setting is set on an Visual Studio IDE instance.

Click the Tools -> Options menu item, and select the "Projects and
Solutions | VB Defaults" node in the Option dialog. The default VB
project
setting values are shown on the right hand. A new VB project will take
these default values when being created. But changing the values of the
default setting won't affect the existing VB projects.

The other setting is set on an individual VB project.

Right click on a VB project in the Solution Explorer and choose
Properties.
In the Project Designer, switch to the Compile tab. The Option explicit,
Option strict and Option compare settings are shown on the right hand.
These settings are set on this particular project.

No matter what values of the VB default setting you set on the VS IDE, if
the 'Option explicit' value of this project is other than 'On' or the
'Option strict' value is other than 'Off' or the 'Option compare' value
is
other than 'Binary', the value is stored in the project file(.vbproj)
respectively.

Open the .vbproj file with Notepad, you can find these values in first
<PropertyGroup> tag if any. For example:

<?xml version = "1.0" encoding="utf-8">
<Project DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003";>
<PropertyGroup>
...
<OptionStrict>On</OptionStrict>
</PropertyGroup>
...
</Project>

If you change the 'Option Strict' value to 'Off' after you set it to
'On',
the value stored in the .vbproj file will become 'Off'.

As for your problem, it seems that the .vbproj file is changed when you
move the package from a machine A to a machine B. You may open the
.vbproj
file with Notepad to check the 'OptionStrict' value on the machine B.

If you couldn't find the 'OptionStrict' tag, the value of this setting in
the Project Designer should be displayed as 'Off'; otherwise, the value
displayed in the Project Designer depends on the value stored in the
project file.

Hope this helps.

Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each
follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.


Huh? The simplest solution is to put the three option statements at the
top of each file. This way the option settings are in the file. Linda,
can a change be made to the next version of the VB IDE to copy the option
settings from the project (or IDE) to the top of the file as soon as the
file is created (similar to the VB6 IDE)?

Mike Ober.




.



Relevant Pages

  • RE: Test View window crashing Visual Studio 2008
    ... My problem seems occur as i add more test projects ... Each time that the IDE crashes i have been sending the Error Report to ... The MSDN Managed Newsgroup support offering is for non-urgent issues ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.vsnet.ide)
  • RE: C# Event Code
    ... As for the C# development IDE, it does be a bit different from the VB.NET ... When you wang to register and event handler for an ASP.NET web control in ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: .Net system service??
    ... Template. ... Writting Windows Service in Win32 is a complex job, ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework)
  • Re: Performance issue
    ... The Malldoc template is located localy and is only 52kB small. ... Microsoft Online Community Support ... You can send feedback directly to my manager at: ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.office.developer.com.add_ins)
  • Re: Option Strict Off/On
    ... On setting is set on an Visual Studio IDE instance. ... Open the .vbproj file with Notepad, you can find these values in first ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.languages.vb)