File Not Found

Apr 22, 2008 at 5:57 PM
Is anyone else having a problem running STSDEV? Every time I run it, I get an exception...

Unhandled Exception: System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
at System.Reflection.Assembly.nLoadFile(String path, Evidence evidence)
at System.Reflection.Assembly.LoadFile(String path)
at stsdev.SolutionBuilder.set_TargetPath(String value)
at stsdev.SolutionBuilder.InitializeSolution()
at stsdev.SolutionBuilder.RunCreateSolutionWizard()
at stsdev.Program.Main(String[] args)

This has happened for empty and web part projects.
Apr 23, 2008 at 9:16 AM
I am getting the same... but only on Server 2008 x64 (not sure about 32bit server)

Works fine for me on Server 2003.

is this a know issue/limitation?

If so is there any chance it will be ported to Server 2008?


flanakin wrote:
Is anyone else having a problem running STSDEV? Every time I run it, I get an exception...

Unhandled Exception: System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
at System.Reflection.Assembly.nLoadFile(String path, Evidence evidence)
at System.Reflection.Assembly.LoadFile(String path)
at stsdev.SolutionBuilder.set_TargetPath(String value)
at stsdev.SolutionBuilder.InitializeSolution()
at stsdev.SolutionBuilder.RunCreateSolutionWizard()
at stsdev.Program.Main(String[] args)

This has happened for empty and web part projects.

Apr 23, 2008 at 11:06 AM
I get similar problems on WS2008 32bit - FileNotFoundException when trying to create a project. It says "The file 'KeyFile.snk' already exists."
I can only create projects with no assembly.
Apr 23, 2008 at 1:41 PM
I have found the "bug" in the source code. Problem is that the BuildProjectAssembly does not work with Framework 3.5.
Work around is to recompile stsdev.exe with a few lines removed:

public static void BuildProjectAssembly() {
Engine engine = null;
//if (SolutionBuilder.SolutionVersionType == SolutionVersionTypeEnum.VS2008_35) {
// engine = new Engine(@"C:\WINDOWS\Microsoft.NET\Framework\v3.5");
//}
//else {
engine = new Engine(@"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727");
//}
Apr 23, 2008 at 10:17 PM
I'm pretty sure this is because the path that you are creating the new solution to already exists and has the KeyFile.snk.

I had the same problem and noticed that i was trying to create a new solution to a directory path that already existed. I changed the path and it all worked.

Maybe the code base needs to be updated t accomadate this?


kerray wrote:
I get similar problems on WS2008 32bit - FileNotFoundException when trying to create a project. It says "The file 'KeyFile.snk' already exists."
I can only create projects with no assembly.

Apr 23, 2008 at 10:18 PM
That worked a treat thanks so much!

Any chance the code base will be updated???


nolsen wrote:
I have found the "bug" in the source code. Problem is that the BuildProjectAssembly does not work with Framework 3.5.
Work around is to recompile stsdev.exe with a few lines removed:

public static void BuildProjectAssembly() {
Engine engine = null;
//if (SolutionBuilder.SolutionVersionType == SolutionVersionTypeEnum.VS2008_35) {
// engine = new Engine(@"C:\WINDOWS\Microsoft.NET\Framework\v3.5");
//}
//else {
engine = new Engine(@"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727");
//}


May 29, 2008 at 3:05 PM
BTW how could I get the snk file?
Jul 24, 2008 at 4:05 PM
Thanks nolsen!  Your solution enabled me to create a WebPart solution.  I'm just curious if this might cause problems later because of it being built this way.
Nov 25, 2008 at 9:20 PM
Is there other bug... in the file Cabdbfbuilder.cs at line 14:;

foreach (SolutionAssembly asm in SolutionBuilder.Assemblies)
 {
        writer.WriteLine(outdir + asm.Location);
 }

here outdir variable puts the fullpath of the project directory but when the cab file is built throws an error for the line generated that was interpreted as text and no as a "relative" location to get a file to include in the result.

In the same way that only the line:

 engine = new Engine(@"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727"); 

works alone the outdir variable must be removed and all works.

The work for this project is well but the documentation and the grow is some down... Thanks for all.
Nov 25, 2008 at 11:07 PM
Ups... a little correction in order to correct my line of code. The correction must be:

writer.WriteLine("\"" + outdir + asm.Location + "\"");

but no delete the outdir variable. With this the cab builder works fine. thanks.
Jan 6, 2009 at 4:12 PM
I found a "no code change" workaround that seems to work so far.  Create the solution/project as a 3.0 version.  Then, when you are browsing to the solution file to open it in VS (but before you actually open it!):
  1. Right click on the .csproj file and do Open With > Notepad
  2. Go to around line 13 and edit the TargetFrameworkVersion element from "v3.0" to "v3.5"
  3. Save and exit
  4. Proceed to open the solution

If you then click on the project properties, it will show the Target Framework as 3.5.  I've deployed the sample web part this way and it seems to work okay.  This also works with STSDEV 2008 which I think is the latest stable release (at least as of the moment--it was released Dec 2, 2008).  Unfortunately, STSDEV 2008 still seems broken when you directly choose 3.5.

Note that I haven't done anything other than deploy the sample, and don't know if the project is pervasively changed over to 3.5.  But it seems useful so far anyway.

Aug 12, 2009 at 2:30 PM

STSDEV 1.3 has still, apparently, this problem.

Developer
Aug 14, 2009 at 3:11 AM

Version 1.4 has now been released and includes this fix.