Formula una domandaFormula una domanda
 

Discussione generaleFileGroupIsNotSupportedInScriptException

  • domenica 28 giugno 2009 6.29Craigfis Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     Contiene codice
    I've just added File group definitions to my VSDB (2008) project and build is now failing with the following exception:
    C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.VisualStudio.TeamSystem.Data.Tasks.targets(105,5)Error MSB4018: The "SqlBuildTask" task failed unexpectedly.
    Microsoft.VisualStudio.TeamSystem.Data.Schema.FileGroupIsNotSupportedInScriptException: Exception of type 'Microsoft.VisualStudio.TeamSystem.Data.Schema.FileGroupIsNotSupportedInScriptException' was thrown.
       at Microsoft.VisualStudio.TeamSystem.Data.Schema.SchemaManager.LoadSchemaObject(String sqlScript, SchemaType expectedType, SchemaManagerCommandContext commandContext)
       at Microsoft.VisualStudio.TeamSystem.Data.Schema.SchemaManager.LoadSchemaObjectFromFile(String path, SchemaType expectedType, SchemaManagerCommandContext commandContext)
       at Microsoft.VisualStudio.TeamSystem.Data.Schema.BuildSchemaObjects.LoadSchemaObjectFromFile(SchemaManager sm, ErrorManager em, String fileName, ConnectionSettings settings)
       at Microsoft.VisualStudio.TeamSystem.Data.Schema.BuildSchemaObjects.BuildSchemaManager(Boolean quotedIdentifier, ConnectionSettings defaultSettings, String suppressedWarnings, BuildConfig config)
       at Microsoft.VisualStudio.TeamSystem.Data.Schema.SqlBuildTaskHelper.Initialize()
       at Microsoft.VisualStudio.TeamSystem.Data.Tasks.SqlBuildTask.Execute()
       at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)
     Done executing task "SqlBuildTask" -- FAILED.

    Any idea why or what the fix for this might be?

Tutte le risposte

  • lunedì 29 giugno 2009 13.20Orlanzo Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     Contiene codice

    I do recall receiving an error when the filegroups were defined within a server project.  I'm unsure if it's what you're receving now, although it may have been.  Are you creating the filegroup in a server or database project? 

    I'm using Filegroups in my solution without error.  They are defined in a database project under:

    Schema Objects >> Database Level Objects >> Storage >> Filegroups


    The script is very basic.

    -- Do not change the database name.
    -- It will be properly coded for build and deployment
    -- This is using sqlcmd variable substitution
    ALTER DATABASE [$(DatabaseName)]
        ADD FILEGROUP [Guideline_Extract_2009_01]
    
    The individual files are defined under:

    Schema Objects >> Database Level Objects >> Storage >> Files


    The script for these appear as:

    -- Do not change the database name.
    -- It will be properly coded for build and deployment
    -- This is using sqlcmd variable substitution
    ALTER DATABASE [$(DatabaseName)]
    	ADD FILE 
    	(
        	NAME = N'Guideline_Extract_2009_01', 
        	FILENAME = '$(DefaultDataPath)$(DatabaseName)_Guideline_Extract_2009_01.ndf', 
        	SIZE = 100000 KB, 
        	MAXSIZE = UNLIMITED, 
        	FILEGROWTH = 100000 KB
        ) TO FILEGROUP Guideline_Extract_2009_01 
    

    Orlanzo
    • Proposto come rispostaGert DrapersMSFTlunedì 29 giugno 2009 16.45
    • Proposta come risposta annullataCraigfis lunedì 29 giugno 2009 17.30
    •  
  • lunedì 29 giugno 2009 17.30Craigfis Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    Yes, this is in a database project and my scripts are basically the same as above.
    Interestingly, if I try to build the project using VS2010 beta, it builds fine. That isn't an acceptable solution for me though - I need to get this working on VSDB 2008.

  • lunedì 29 giugno 2009 17.51Orlanzo Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     

    Can you share the scripts you're using?


    Orlanzo
  • lunedì 29 giugno 2009 18.22Craigfis Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    If I simply add a default filegroup script to the Filegroups folder without editing it I get the error.

    -- Do not change the database name.
    -- It will be properly coded for build and deployment
    -- This is using sqlcmd variable substitution
    ALTER DATABASE [$(DatabaseName)]
     ADD FILE
     (
         NAME = [SqlFile1],
         FILENAME = '$(DefaultDataPath)$(DatabaseName)_SqlFile1.ndf',
         SIZE = 3072 KB,
         MAXSIZE = UNLIMITED,
         FILEGROWTH = 1024 KB
        )
     
  • lunedì 29 giugno 2009 18.34Craigfis Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    I tried creating a new database project and adding a filegroup to it. That builds OK.
    I don't really want to have to recreate my database project if I can avoid it...
  • lunedì 29 giugno 2009 18.59Orlanzo Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    I just did the same and it built without error.  Did you happen to change any of the database properties through the Prjoect Settings page?  These are defined in the Catalog properties file.  Is this a 2005 or 2008 database project?

    Also what version of Visual Studio are you using?  I'm at version 9.1.40413.00 of Microsoft Visual Studio Team System 2008 Database Edition GDR.
    Orlanzo
  • lunedì 29 giugno 2009 19.16Craigfis Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    Same VS version - VSDB GDR (9.1.40413.00)
    Targetting SQL 2005.
    I copied the settings file from my real project to the new dummy project and that still builds OK.
  • lunedì 29 giugno 2009 19.40Craigfis Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    By comparing the newly created project file with my failing project file I've found the cause of the problem.
    The targets file that is being referenced by the new project is different than that referenced by the existing project (which was created prior to GDR - I omitted that tidbit earlier).

    New GDR projects use this:
      <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets" />

    My failing project was using this:
      <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.VisualStudio.TeamSystem.Data.Tasks.targets" />

    I guess there's a bug here in that GDR should convert the project to the newer target file?
  • lunedì 29 giugno 2009 20.59Orlanzo Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    I'm wondering if the ...ProjectVersion.. tag in each of the dbproj files are the same.
    Orlanzo
  • lunedì 29 giugno 2009 22.35Craigfis Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    Yes, both had  the same project and schema version:
        <SchemaVersion>2.0</SchemaVersion>
        <ProjectVersion>3.5</ProjectVersion>
  • martedì 30 giugno 2009 12.09Orlanzo Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    That is pretty interesting.  The project and schema versions are the same in my files as well.  In the same file, I see a PreviousProjectVersion tag that I presume is an indication of a converted project.  One of the moderators may be able to explain why this occurred or answer to whether this is a bug.
    Orlanzo
  • martedì 14 luglio 2009 22.51Jill McClenahanMSFTMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     

    What was your starting project (VS 2005 or VS 2008 Orcas)?  And did you convert directly to GDR R2 or did you upgrade to GDR and then R2?  We will investigate to see if we can repro this bug.

    Thanks,
    Jill

  • martedì 4 agosto 2009 17.46Barclay HillMSFT, ModeratoreMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    Hi Craig,

    I cant repro this from an upgrade of a 2008 Visual Studio Team System Database Edition SP1 Project to a GDR R2 Project.  Were you using the earlier power tools with the pre GDR project?

    Can you send my your old project so I can get a repro on this issue?

    http://blogs.msdn.com/bahill/contact.aspx

    Thanks,
    Barclay Hill Program Manager VSTS: DB Team (DataDude, DBPro, Database Edition) Please mark the responses as answer if it resolves your question.
  • lunedì 24 agosto 2009 22.36Barclay HillMSFT, ModeratoreMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
     

    Hi Craig,

     

    This thread has been changed to a “General Discussion” since you have not followed up with the necessary information. If you have the time to revisit the issue and provide additional information, please feel free to respond and change the issue type back to “Question”.

     

    If the issue is resolved, we would appreciate it if you can share your solution or information with other forum members who may have similar questions or issues.

     

    Thanks.


    Barclay Hill Program Manager VSTS: DB Team (DataDude, DBPro, Database Edition) Please mark the responses as answer if it resolves your question. http://blogs.msdn.com/bahill
  • martedì 20 ottobre 2009 17.49bjkj Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     

    Was there any additional information on this topic?  We just upgraded to GDR2 and have been getting a few errors.  This is one of them.

  • martedì 20 ottobre 2009 19.54tomsmiMSFTMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    Hi bjkj,

    You are getting the NotSupportedInScript exception in GDR R2?  If so, can you check your project file to see if this is in there:
      <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.VisualStudio.TeamSystem.Data.Tasks.targets" />

    If so, that line should be changed to this:
      <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets" />

    Easiest way to check this is to open the .dbproj file in Notepad. 

    Thanks,
    -Tom

    Tom Smith, SDET - Microsoft Visual Studio Team Edition for Database Professionals
  • martedì 20 ottobre 2009 20.22bjkj Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    Ok, so it looks like I caused this issue by trying to solve another.  I changed the line you mentioned above because I was getting an error stating the "SqlBuild" target was missing.  I noticed the Microsoft.Data.Schema.SqlTasks.targets file does not have the "SqlBuild" target so I switched it to the Microsoft.VisualStudio.TeamSystem.Data.Tasks.targets file. 

    I have switched the Import back and am back to the original error: "The target "SqlBuild" does not exist in the project".

    Do I need to specify both import files?
  • mercoledì 21 ottobre 2009 17.35Christian WhiteheadMSFTMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    The only import that you need is:

      <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets" />

    Before you upgraded did you have any PowerTools installed?

    Also, would it be possible for me to get a copy of your project?


    This posting is provided "AS IS" with no warranties, and confers no rights
  • mercoledì 21 ottobre 2009 19.51bjkj Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    Thanks for your help.

    Yes I had the Power Tools installed.  I currently have the 2008 Database Edition - Power Tools installed ver 9.0.1.  FYI, I opened a new thread dedicated to this topic thinking this thread might be stale and not easily identified by the initial question.