Known Issues
New Symptom: Upon installation of the CTP, smart tags no longer appear when editing C# code. A few Visual Studio commands also disappear along with the refactoring submenu of the C# code editor context menu.
Cause and Workaround: A component of the C# language service (responsible for the C# coding experience in Visual Studio) is registered improperly by both the installer MSI and the lightweight C# IDE integration installer script in the LINQ Preview\Bin directory. To work around this, please follow these steps:
- Start up RegEdit.exe
- Open HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Packages\{A066E284-DCAB-11D2-B551-00C04F68D4DB}\SatelliteDLL
- Edit the "Path" value and change it from "C:\Program Files\Microsoft Visual Studio 8\VC#\VCSPackages\1033\" to "C:\Program Files\Microsoft Visual Studio 8\VC#\VCSPackages\"
- Then run devenv /setup /resetuserdata /resetsettings
New Symptom: The install may fail on Windows XP Home with the message "An error occurred while applying security settings. Power Users is not a valid user or group"
Cause and Workaround: The cause is due to the installer MSI's attempt to make the provided samples available to non-Administrators. To allow the install to complete, create a group with the name from the error message – the MSI will no longer complain that it is missing. This group can be deleted as soon as the installation is complete.
New Symptom: After the CTP is installed no new LINQ-specific project or item templates are added.
Cause and Workaround: This is caused by a faulty assumption that if the Visual Basic language service is present in your Visual Studio install location, the Visual Basic option was checked upon installation and all other VB-related components are also present. This is not always the case. The end result is that if Visual Basic was not installed, item and project templates will not be installed with the CTP. To work around this issue, uninstall the CTP, open the Visual Studio 2005 installer in Maintenance Mode, select Add or Remove Features, select Visual Basic, complete the installation, then reinstall the CTP.
Symptom: When querying against a DLinq object, if the query's Where clause accesses a property of a control, you may receive the following error: "The method 'Designer_051906_vb.Form1.get_CityTextBox' is not a property accessor." This issue also applies to the DLinq Designer Walkthrough. For example, the following query references CityTextBox's Text property, which leads to the error.
Dim results = From c In nwDataContext.Customers _
Where c.City = CityTextBox.Text _
Select c
Cause and Workaround: Currently the expression tree only looks at public properties; the workaround is to change the access modifier on the control from Friend to Public. To do this, select the control, and in the Properties window change the Modifiers property from Friend to Public. For the DLinq Designer Walkthrough specifically, you'll need to make this change on CityTextBox.
Alternatively, you could replace the query's reference to the Textbox with a local String variable:
Dim str As String = CityTextBox.Text
Dim results = From c In nwDataContext.Customers _
Where c.City = str _
Select c
Symptom: LINQ project types do not show up in the New Project dialog.
Cause and Workaround: The installer creates the project templates in the default location for Visual Studio 2005: %USERPROFILE%\My Documents\Visual Studio 2005\Templates\ProjectTemplates. If this default has changed then the templates will not appear in the New Project dialog. You can see the current location for these templates by going to Tools\Options (Show all settings must be checked) Project and Solutions\General\Visual Studio user project templates location. The workaround is to manually copy the LINQ*.zip files from %USERPROFILE%\My Documents\Visual Studio 2005\Templates\ProjectTemplates to the correct templates directory you see there.
Symptom: The DLinq queries within the SampleQueries project are not working.
Cause and Workaround: You must have SQL Server 2005 Express (included with VS 2005) installed to run the DLinq samples as is. If you are running a non-Express version of SQL Server 2005 or are running SQL Server 2000a, some minor changes are required to the SampleQueries project before the DLinq samples will work:
- For SQL Server 2005 (non-Express):
- The sqlServerInstance constant in the SampleQueries project must be modified to point to a valid SQL Server instance.
- For SQL Server 2000a:
- The connString constant in the SampleQueries project must be modified to point to the SQL Server 2000a Northwind sample database within a valid SQL Server 2000a instance. The NORTHWND.MDF file referenced by the included connection string is only compatible with SQL Server 2005.
If you do have SQL Server 2005 installed and the samples are still not working, especially if you have just uninstalled and reinstalled this package, try the following:
- Open SQL Server Express Manager, which you can download here.
- Connect to the .\SQLEXPRESS instance.
- In the Query Editor to the right, make sure 'master' is selected in the dropdown and type the following query (replacing 'C:\PROGRAM FILES' with the path of your Program Files folder):
EXEC sp_detach_db 'C:\PROGRAM FILES\LINQ PREVIEW\DATA\NORTHWND.MDF'.
- Click Execute in the toolbar. Ignore any error messages you receive about closing the database. This should remove the old reference to Northwnd.MDF so that SQL Server can properly auto-attach to the database again.
Symptom: When attempting to use one of the new features, you see an error stating that a particular query operator is not a member of a particular type. For example, "'Where' is not a member of 'System.Array'" or that a particular type is not defined such as, "'System.XML.XLinq.XElement' is not defined."
Cause and Workaround: The LINQ feature-set requires a special set of references to System.Query.dll, System.Data.DLinq.dll, and System.XML.XLinq.dll. When creating a new project and attempting to access the LINQ features, be sure to create a new LINQ enabled project by selecting the LINQ category in the Visual Basic project types in the Create New Project dialog.
Symptom: Non-LINQ projects get a runtime error stating that the reference to Microsoft.VisualBasic.dll cannot be found.
Cause and Workaround: The installer replaces Microsoft.VisualBasic.dll for all solutions. When Project LINQ: Visual Basic Tech Preview is uninstalled the 50727.42 (MSDN Tech Preview) is restored. Non-LINQ projects need to be rebuilt to reestablish their dependency on the original Microsoft.VisualBasic.dll.
Symptom: The connection to the Northwind database fails in the DLinq samples.
Cause and Workaround: The connection string is targeting the default instance of SQLExpress. If you do not have SQLExpress installed, you can copy the Northwnd.mdf and Northwnd_LOG.ldf from the SampleQueries folder to another folder. Use these files to attach the Northwind database to your SQL Server (make sure that the name of the database is Northwind). Then updated the connString variable at the top of the DLinqSamples.vb to:
Private Shared ReadOnly connString As String = "Integrated Security=SSPI;database=northwind;server=myservername"
Note: the reason you should copy the DB files to another folder is that uninstalling LINQ: Visual Basic May Tech Preview will then not require detaching the database from the server.
Symptom: When opening a project created in a previous CTP you see the following error message: "Unable to read the project file 'myapp.vbproj'…the imported project "C:\Program Files\VB LINQ Preview\Bin\Microsoft.VisualBasic.LINQ.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk."
Cause and Workaround: The directory structure has changed since this CTP is a combined release of both Visual Basic and C#. Open the .vbproj file using notepad and find the string "VB LINQ Preview\Bin\Microsoft.VisualBasic.LINQ.targets." Replace this with "LINQ Preview\Misc\Microsoft.VisualBasic.LINQ.targets" and then save and re-open the project.
Symptom: The command-line compiler does not recognize VB 9.0 features.
Cause and Workaround: The command-line compiler is not replaced in the frameworks directory. A LINQ-enabled command-line compiler is available in the LINQ directory which can be found in the Bin directory.
Symptom: When generating UI from the Data Sources Window, you see the following error: "The type 'System.Data.DLinq.EntitySet`1[[LINQWindowsApplication1.Order_Detail' could not be found. Ensure that the assembly containing the type is referenced. If the assembly is part of the current development project, ensure that the project has been built."
Cause and Workaround: This can happen if UI was created for a class, and the class was then changed through the DLinq designer and then you try to generate additional UI. This happens because the type information cached by the designer is not valid anymore. To get around this please restart Visual Studio.
Symptom: When using XML Literals in a script block inside an ASP.NET project, some of the XML elements are not colored correctly in the IDE.
Cause and Workaround: This is a known issue; the workaround for now is to put the code in a code-behind file.
Symptom: You see the message "This is an unsupported version of Microsoft Visual C# 3.0 / Microsoft Visual Basic 9.0. Therefore, many features may not work as expected" several times when using Visual Studio.
Cause and Workaround: Oftentimes installed Addins will cause this message to appear multiple times. You can turn off the message by setting the following DWORD registry key to 0: HKCU\Software\Microsoft\VisualStudio\8.0\CSharp\Options\Editor\DisplayAlphaWarning. If you're using one of the Express editions then change "VisualStudio" to "VBExpress" or "VCSExpress" as appropriate.
Symptom: DLinq Designer - If you try to drag and drop database objects from any schema other than the default, nothing is created on the designer surface.
Cause and Workaround: The current version of the DLinq Designer only handles database objects that are in the default schema. You can work around this issue by dragging a class from the toolbox onto the designer and setting the TableName property to the fully qualified name of the database object (e.g. Schema1.Table1).
Symptom: Installing the C# language service updates in the preview will cause invoking refactoring through the class designer to fail.
Cause and Workaround: This is a very early version of the C# language service. Please uninstall it by following the directions in "Readme for C#.htm" file in the preview directory.
Symptom: DLinq throws exception for certain join queries written in Visual Basic
Cause and Workaround: A small class of expression trees are not correctly translated. A workaround is to define local variables for the sequences that are joined. For example:
Instead of
Dim custsLond = From cust In db.customers, sup In db.suppliers _
Where cust.Country = sup.Country _
Select cust.CompanyName
Use
Dim customers = db.Customers
Dim suppliers = db.Customers
Dim custsLond = From cust In customers, sup In suppliers _
Where cust.Country = sup.Country _
Select cust.CompanyName
Symptom: Invalid SQL generated for query expressions written in Visual Basic containing "And" operator in Where clause.
Cause and Workaround: Incorrect translation of the "And" operator. Use "AndAlso" operator instead.
Symptom:An error occurs while running the install/uninstall C# IDE support script on Windows Vista with LUA turned on
Cause and Workaround:
luaexec -f -w Wscript.exe "Install C# IDE Support.vbs"
or
luaexec -f -w Wscript.exe "unnstall C# IDE Support.vbs"