.NET Developers Q&A
.NET Development: Questions and Answers.
If you experience the error message:
The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine
this is caused by the Jet provider not being available in native 64-bit.
You will have to target x86 with your .NET apps to make it work.
Prerequisites:
Situation:
- After "optimizing" the VM the file grows (in my case from 13 GB to 100 GB, which is the maximum size of the dynamic disk)
Workaround:
- Create a full clone of your VM (this copies all the linked disks + your VM into a target disk). You are not using the base disks from that moment on. But the resulting VM will be nice and small and in the future you can use PerfectDisk again to optimize and shrink your VM.
Background:
- VMs with linked disks are not available for SHRINK operations.
- WIthout linked disks this works perfectly.
Situation:
- You have a linked clone.
- You do not have any snapshots, just the current state.
- You want to create a full clone out of the base image(s) and the current state using the VMware Wizard.
- You get the error message that you need (3.5 GB) of free hard drive space.
- Freeing space on the source and target drive does not seem to help.
Solution
- Just create a snapshop and re-try the full-clone-creation.
Enjoy!
A nasty one, you will probably realize in front of customers.
The workaround can be found on the Windows SDK blog.
Enjoy!
If you try to drag tables from the Server Explorer of Visual Studio 2008 to the designer surface of the Link-to-SQL designer you'll probably be surprised to see the error message stating:
"The selected object(s) use an unsupported data provider"
However you can use SqlMetal.exe to generate the .dbml file manually (obviously: command line instead of drag & drop).
If you get that nice error message change your solution configuration to target 32-bit (x86) using configuration manager.
For more information read this.
Microsoft released a hotfix [1] for Visual Studio 2008 (also targeting Visual Web Developer Express) that corrects several issues with the web development features.
At this time the hotfix is only available for the English and Japanese versions.
List of things that were corrected according to this post [2] by Vinaya Reddy:
HTML Source view performance
- Source editor freezes for a few seconds when typing in a page with a custom control that has more than two levels of sub-properties.
- “View Code” right-click context menu command takes a long time to appear with web application projects.
- Visual Studio has very slow behavior when opening large HTML documents.
- Visual Studio has responsiveness issues when working with big HTML files with certain markup.
- The Tab/Shift-Tab (Indent/Un-indent) operation is slow with large HTML selections.
Design view performance
- Slow typing in design view with certain page markup configurations.
HTML editing
- Quotes are not inserted after Class or CssClass attribute even when the option is enabled.
- Visual Studio crashes when ServiceReference element points back to the current web page.
JavaScript editing
- When opening a JavaScript file, colorization of the client script is sometimes delayed several seconds.
- JavaScript Intellisense does not work if an empty string property is encountered before the current line of editing.
Web Site build performance
- Build is very slow when Bin folder contains large number of assemblies and .refresh files with web-site projects.
Make sure to read the installation instructions at [2].
Enjoy!
[1] https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=10826
[2] http://blogs.msdn.com/webdevtools/archive/2008/02/09/downloadable-hotfix-performance-and-editor-fixes-for-microsoft-visual-studio-2008-and-visual-web-developer-express-2008.aspx
The program
class Program
{
static void Main(string[] args)
{
foreach (System.Environment.SpecialFolder value in Enum.GetValues(typeof(System.Environment.SpecialFolder)))
{
Console.WriteLine(Enum.GetName(typeof(System.Environment.SpecialFolder), value) + " = " + System.Environment.GetFolderPath(value));
}
}
}
The output on Windows XP
Desktop = C:\Documents and Settings\Neno\Desktop
Programs = C:\Documents and Settings\Neno\Start Menu\Programs
Personal = D:\My Documents
Personal = D:\My Documents
Favorites = C:\Documents and Settings\Neno\Favorites
Startup = C:\Documents and Settings\Neno\Start Menu\Programs\Startup
Recent = C:\Documents and Settings\Neno\Recent
SendTo = C:\Documents and Settings\Neno\SendTo
StartMenu = C:\Documents and Settings\Neno\Start Menu
MyMusic = D:\My Documents\My Music
DesktopDirectory = C:\Documents and Settings\Neno\Desktop
MyComputer =
Templates = C:\Documents and Settings\Neno\Templates
ApplicationData = C:\Documents and Settings\Neno\Application Data
LocalApplicationData = C:\Documents and Settings\Neno\Local Settings\Application Data
InternetCache = C:\Documents and Settings\Neno\Local Settings\Temporary Internet Files
Cookies = C:\Documents and Settings\Neno\Cookies
History = C:\Documents and Settings\Neno\Local Settings\History
CommonApplicationData = C:\Documents and Settings\All Users\Application Data
System = C:\WINDOWS\system32
ProgramFiles = C:\Program Files
MyPictures = D:\My Documents\My Pictures
CommonProgramFiles = C:\Program Files\Common Files
The output on Windows Vista
Desktop = C:\Users\Neno\Desktop
Programs = C:\Users\Neno\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
Personal = C:\Users\Neno\Documents
Personal = C:\Users\Neno\Documents
Favorites = C:\Users\Neno\Favorites
Startup = C:\Users\Neno\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
Recent = C:\Users\Neno\AppData\Roaming\Microsoft\Windows\Recent
SendTo = C:\Users\Neno\AppData\Roaming\Microsoft\Windows\SendTo
StartMenu = C:\Users\Neno\AppData\Roaming\Microsoft\Windows\Start Menu
MyMusic = C:\Users\Neno\Music
DesktopDirectory = C:\Users\Neno\Desktop
MyComputer =
Templates = C:\Users\Neno\AppData\Roaming\Microsoft\Windows\Templates
ApplicationData = C:\Users\Neno\AppData\Roaming
LocalApplicationData = C:\Users\Neno\AppData\Local
InternetCache = C:\Users\Neno\AppData\Local\Microsoft\Windows\Temporary Internet Files
Cookies = C:\Users\Neno\AppData\Roaming\Microsoft\Windows\Cookies
History = C:\Users\Neno\AppData\Local\Microsoft\Windows\History
CommonApplicationData = C:\ProgramData
System = C:\Windows\system32
ProgramFiles = C:\Program Files
MyPictures = C:\Users\Neno\Pictures
CommonProgramFiles = C:\Program Files\Common Files
Note: On the Window XP machine the My Documents folder was moved to drive D.
Larry asked in the MSDN Forums why the following command line:
svcUtil http://localhost/MyService.svc?wsdl /dconly
raises this error:
Error: The input read from 'http://localhost/MyService.svc?wsdl' is inconsistent with other options.
The essential note is stated in the Windows SDK Release Notes (Link):
5.4.11 Service Model Metadata Utility Tool (SvcUtil.exe) Can’t Generate Data Contracts from a Running Service
An example at the end of the svcutil.exe help output indicates that you can use the /dataContractOnly (/dconly) option to generate Data Contracts from a running service:
svcutil /dconly http://service/metadataEndpoint
- Generate Data Contract types from a running service or online metadata documents.
This usage does not work. You can only use the /dconly option to generate Data Contracts from local metadata files.
I often see people staring at the slides where it states Vista (and Windows Server 2008) does have a transactional files system and registry.
Yes, it’s true and you can read find out more in this MSDN Magazine article.
Dominick [1] pointed me a great tip today how to turn of the hosting process (vshost.exe) [2]. This might be interesting for those of you who are debugging applications on Windows Vista with UAC manifests, which sometimes has strange side effects.
[1] http://www.leastprivilege.com/
[2] http://msdn2.microsoft.com/en-us/library/ms185330(VS.80).aspx
Microsoft released an update for enabling .NET Framework 1.1 applications to use the SendKeys command under Windows Vista without experiencing the "Hook cannot be created" error message (as explained in this KB article).
The ClickOnce publishing Wizard on Windows Vista generates the following error message:
"Failed to connect to 'http://localhost/WindowsApplication1/' with the following error: Unable to create the Web 'http://localhost/WindowsApplication1/'. The Web server does not appear to have the FrontPage server extensions installed."
To solve this you need to do two basic things (thanks to my thinktecture colleague Dominick Baier):
- Configure IIS to run in IIS6 Compatibility Mode.
- Run Visual Studio as an Administrator.
Read the whole story (at Brian Noyes' Blog).
Did you use ClickOnce with .NET Framework 2.0 and got the error message "Proxy authentication required"?
Are the accessing machines configured to use a proxy server that requires authentication?
If you answer both questions with YES: then you found a bug.
The good news is - there is a solution. You can request a fix (free of charge) at a Microsoft support holine and it will be (e-)mailed to you:
KB Artikel 917952: FIX: Error message when you try to install a ClickOnce application that you created in the .NET Framework 2.0 onto a client computer that is configured to use a proxy server: "Proxy authentication required"