Manually creating a .sln file

G

Guest

Hi,

Due to a project I am working in, I need to generate a solution file
automatically that includes one C# project. I have taken the format for that
..sln file from existing solution files created by VS.NET 2003. I only
generate two new GUIDs. This is the template that I use:
-----------------------
Microsoft Visual Studio Solution File, Format Version 8.00
Project("CS_GP_PackageGUID") = "CS_GP_OriginalProjName",
"CS_GP_OriginalProjName.csproj", "CS_GP_ProjectGUID"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Release = Release
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
CS_GP_ProjectGUID.Debug.ActiveCfg = Debug|.NET
CS_GP_ProjectGUID.Debug.Build.0 = Debug|.NET
CS_GP_ProjectGUID.Release.ActiveCfg = Release|.NET
CS_GP_ProjectGUID.Release.Build.0 = Release|.NET
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal
---------
I replace CS_GP_PackageGUID with a generated GUID and CS_GP_ProjectGUID with
another. The first GUID is for the solution and the second for the project.

When I try to open the .sln file with VS.NET, I get a message "The
application for project '...' is not installed. Make sure the application for
the project type (.csproj) is installed".

And the only way to incorporate the project in the solution is to open it
with VS.NET and remove it and reload it. This changes the first GUID
(CS_GP_PackageGUID). After that the project is incorportated correctly into
the solution.

It seems to me that the GUID needs to be generated by the solution.
But, there should be a way to force it to accept a GUID provided by me or to
somehow figure out what is so special about the GUID generated by VS.NET.


Please help!
Juan Dent
 
M

Mattias Sjögren

Juan,
It seems to me that the GUID needs to be generated by the solution.
But, there should be a way to force it to accept a GUID provided by me or to
somehow figure out what is so special about the GUID generated by VS.NET.

That GUID is used to identify the project as a C# project, so you
shouldn't change it.



Mattias
 
G

Guest

Hi,

Ok, so is there a way (similar to a VBA macro) in which I can add the
project to the solution via some kind of script?

Thanks,
Juan Dent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top