ssteenkiste / nettiers

Automatically exported from code.google.com/p/nettiers
1 stars 0 forks source link

Project GUID issue in Visual Studio (Patch Included) #368

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
***** What steps will reproduce the problem? *****

When generating & re-generating code for multiple databases the project GUIDS 
are not unique. This causes build faults and causes visual studio intellisense 
to be erratic.

***** What is the expected output? What do you see instead? *****

I would expect each project to contain a unique GUID which remains the same 
after a re-gen.

***** What version of .netTiers and CodeSmith are you using? *****

.netTiers = 2.3.1
CodeSmith = 5.3.1

***** Please provide any additional information below. *****

I've attached a revised .cst of the changes which is comprised of....

1. Added new private method GetProjectGuid to region "Private helper methods"
2. New region "Set Project FileNames"
3. Revised region "Set Guids" to use above method(1) and variables(2)
4. Revised project rendering to use filenames in (2)

Original issue reported on code.google.com by d...@hypercode.co.uk on 10 Feb 2011 at 12:31

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 10 Feb 2011 at 1:30

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 10 Feb 2011 at 1:31

GoogleCodeExporter commented 9 years ago
Hello,

It appears that you are missing your code behind changes in the 
CommonSqlCode.cs file. Could you please attach a svn patch file for this.

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 10 Feb 2011 at 1:34

GoogleCodeExporter commented 9 years ago
Hi Blake,

I've only made changes to the .cst file.

regards,
Dave.

Original comment by d...@hypercode.co.uk on 10 Feb 2011 at 1:36

GoogleCodeExporter commented 9 years ago
Hello,

My apologies, I thought you added that method as I've never seen it before in 
the .netTiers code base. Just goes to show how large the code base actually is. 
I've went a head and made these changes in revision 879.

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 10 Feb 2011 at 7:33

GoogleCodeExporter commented 9 years ago
Thanks for adding that Blake.

The method is a new one, it just happens to be in the .cst file rather than the 
CommonSqlCode.cs file.

I've checked the diff and it's still there, right at the bottom.

cheers,
Dave Osborne.

Original comment by d...@hypercode.co.uk on 11 Feb 2011 at 9:20

GoogleCodeExporter commented 9 years ago
This is funny, I have this exact same change in my templates and I thought for 
sure I committed this.  You did it almost exactly like I did.  The only 
difference is I made an option and I used the Default Guid Values if I couldn't 
find the project file.  You use Guid.NewGuid().  I think the way you did it is 
fine.

I used an XmlReader instead of an XmlDocument but again I think you are ok.

string guid = string.Empty;

            if(File.Exists(fileName))
            {

                try
                {
                    using (XmlReader reader = XmlReader.Create(fileName))
                    {
                        reader.ReadToDescendant("ProjectGuid");
                        guid = reader.ReadString();

                        guid = guid.Substring(1, guid.Length - 2);
                    }
                }
                catch(Exception e)
                {
                    Debug.WriteLine("Could not locate the project guid with the file [" + fileName + "]");
                }
            }

            return guid;

Original comment by jmhin...@gmail.com on 11 Feb 2011 at 8:35