Results 1 to 4 of 4

Thread: Visual Basic 2008 error "Option Strict On disallows implicit conversions"

  1. #1
    Join Date
    Jun 2009
    Posts
    761

    Visual Basic 2008 error "Option Strict On disallows implicit conversions"

    I have some urgent query about Visual Basic 2008. Due to some important reason i need to compile Windows Presentation Foundation application in Microsoft Visual Basic 2008 on my Windows Vista computer. While doing this process, i always keep getting a error message stating "Option Strict On disallows implicit conversions from 'System.Windows.Application' to 'WpfApplication1.Application'." I tried it doing many times but the same result. Could you guys please make me know how to fix this error ? Please help me soon....

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Visual Basic 2008 error "Option Strict On disallows implicit conversions"

    Most probably this issue occurs if the value of the Option Strict statement is "On" at the project level. In order to fix it easily, i'll suggest you to download an updated WPF template . To install the updated template, put the .compressed file with a .zip file name extension in the \Visual Studio 2008\Templates\ProjectTemplates\Visual Basic folder, and then restart Visual Studio 2008. After you install the updated template, the updated template appears in the New Project dialog box in the My Templates section. This section is located under the Visual Studio installed templates section.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: Visual Basic 2008 error "Option Strict On disallows implicit conversions"

    You can also set Option Strict in the Visual Studio integrated development environment (IDE) or on a command line. To set Option Strict in the integrated development environment (IDE):-

    1. On the Tools menu, choose Options.
    2. Open the Projects and Solutions node.
    3. Choose VB Defaults.
    4. Modify the Option Strict setting.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Visual Basic 2008 error "Option Strict On disallows implicit conversions"

    You can also try modifying the code in the Mywpfextension.vb file to fix out the said issue. To modify the code in the Mywpfextension.vb file, follow these steps:

    • Under Error List, double-click the error message that the "Symptoms" section describes. The Mywpfextension.vb file opens.

    • Locate the following line of code:
      Code:
      Return Global.System.Windows.Application.Current
    • Modify the code in step 2 as follows:


      Code:
      Return CType(Global.System.Windows.Application.Current, Application)
    • Build the project again.

Similar Threads

  1. Difference between Implicit & Explicit type conversions
    By Sarfaraj Khan in forum Software Development
    Replies: 5
    Last Post: 09-02-2010, 02:47 PM
  2. Error "Calculating permissions failed" in Visual Studio 2008
    By mesterio in forum Windows Software
    Replies: 3
    Last Post: 15-10-2009, 07:45 PM
  3. Error Code 1330 while installing Visual Basic 2008
    By Capers in forum Windows Software
    Replies: 2
    Last Post: 02-05-2009, 07:11 PM
  4. How to avoid the warnings "implicit declaration"
    By Jacek in forum Software Development
    Replies: 4
    Last Post: 10-04-2009, 11:43 PM
  5. Replies: 8
    Last Post: 13-01-2008, 02:18 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,038,643.50581 seconds with 17 queries