I had this problem and solved it.

I don't know precisely why it occurred in the first place as I loathe Windows and try to have as little to do with it as possible except as a vehicle which happens to run VS2K8 and F# and therefore have less than zero interest in thinking about the mechanics of how installation can go awry. But the fix is easy. Please read on.

OK, so I have two accounts - Administrator, and a user account.

Naturally I installed F# CTP using Administrator.

Everything worked fine in Administrator Account.

However, when I tried to run FSI.EXE from the start menu in my user account, no good.

The Fix:

When logged in as Administrator, delete all the shortcuts in the F# start menu folder.

Re-create them by going to the actual file locations and creating new shortcuts, then name them appropriately and drag to start menu folder.

Problem solved. Everything now works fine from the user account too.

Don't know why it works, but would be interested to hear from Windows experts why it does work.

By on 12/12/2008 7:39 PM ()

Forgot to state that I run XPSP3 (relevant) in VMware Fusion (hopefully irrelevant).

By on 12/12/2008 7:41 PM ()

Hm, you are the second person to report this symptom this week (though up until now we have not heard of this issue).

If you are willing to help me diagnose it, please try the following steps:

Start up an instance of VS (as an administrator)
- Tools\Options\Debugging\General
- uncheck 'Enable the exception assistant'
- uncheck 'Enable just my code'
- Debug\Exceptions
- check the 'thrown' box next to 'Common Language Runtime Exceptions'

Start a second instance of VS
- operate up to just before the point where you get the 'Invalid URI' dialog (e.g. File\New project\..., right up to before you select the F# project)

Go back to first VS instance. Tools\Attach To Process, Select the "devenv.exe" that corresponds to the other VS.

Now VS #1 is debugging VS #2.

Back in second instance of VS, try to open the F# project.

You'll start seeing exceptions in the first VS, with options to 'break' or 'continue'. Keep selecting 'continue' until you see the exception about the invalid URI. When you reach that one, choose 'break'.

Debug\Windows\Callstack - highlight it all, copy (ctrl-insert), and send a copy

Debug\Windows\Locals - see what information you can get out of this window, especially more details about the exception or what the URI was

If you can send this info to fsbugs it may help diagnose the issue.

By on 11/24/2008 4:36 PM ()

Ok, someone has sent me this info, so no need to send it.

I am still trying to ascertain (1) under what conditions this happens and (2) if there is a workaround.

damageboy, could you share the output of this C# program when run on your system?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
using System;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(">>>{0}<<<", Environment.GetFolderPath(Environment.SpecialFolder.System));
            Console.WriteLine(">>>{0}<<<", Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles));
            Console.WriteLine(">>>{0}<<<", Environment.GetFolderPath(Environment.SpecialFolder.Startup));
        }
    }
}
By on 11/24/2008 5:52 PM ()
1
2
3
>>>C:\Windows\system32<<<
>>>C:\Program Files<<<
>>><<<
By on 11/24/2008 10:38 PM ()

Ok, please try running the following C# program. This will recreate your startup folder, and hopefully solve the problem with F#.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System;
using System.Runtime.InteropServices;
using System.Text;

namespace ConsoleApplication2
{
    static class NativeMethods
    {
        [DllImport("shell32.dll")]
        public static extern int SHGetFolderPath(IntPtr hwndOwner, int nFolder, IntPtr hToken, uint dwFlags, [Out] StringBuilder pszPath);
    }
    class Program
    {
        static void Main(string[] args)
        {
            int CSIDL_STARTUP = 0x0007;
            int CSIDL_FLAG_CREATE = 0x8000;
            Console.WriteLine(">>>{0}<<<", Environment.GetFolderPath(Environment.SpecialFolder.System));
            Console.WriteLine(">>>{0}<<<", Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles));
            Console.WriteLine(">>>{0}<<<", Environment.GetFolderPath(Environment.SpecialFolder.Startup));
            StringBuilder path = new StringBuilder();
            NativeMethods.SHGetFolderPath(new IntPtr(0), CSIDL_STARTUP | CSIDL_FLAG_CREATE, new IntPtr(0), 0, path);
            Console.WriteLine("---{0}---", path.ToString());
            Console.WriteLine(">>>{0}<<<", Environment.GetFolderPath(Environment.SpecialFolder.Startup));
        }
    }
}

If it doesn't work, try changing STARTUP to 0x0018. If it still doesn't work, try manually creating the directory

1
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\
By on 11/26/2008 2:01 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper