Odeslat dotazOdeslat dotaz
 

Obecná diskuseFileGroupIsNotSupportedInScriptException

  • 28. června 2009 6:29Craigfis Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     Obsahuje kód
    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?

Všechny reakce

  • 29. června 2009 13:20Orlanzo Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     Obsahuje kód

    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
    • Navržen jako odpověďGert DrapersMSFT29. června 2009 16:45
    • Zrušeno navržení jako odpověďCraigfis 29. června 2009 17:30
    •  
  • 29. června 2009 17:30Craigfis Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     
    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.

  • 29. června 2009 17:51Orlanzo Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     

    Can you share the scripts you're using?


    Orlanzo
  • 29. června 2009 18:22Craigfis Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     
    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
        )
     
  • 29. června 2009 18:34Craigfis Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     
    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...
  • 29. června 2009 18:59Orlanzo Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     
    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
  • 29. června 2009 19:16Craigfis Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     
    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.
  • 29. června 2009 19:40Craigfis Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     
    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?
  • 29. června 2009 20:59Orlanzo Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     
    I'm wondering if the ...ProjectVersion.. tag in each of the dbproj files are the same.
    Orlanzo
  • 29. června 2009 22:35Craigfis Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     
    Yes, both had  the same project and schema version:
        <SchemaVersion>2.0</SchemaVersion>
        <ProjectVersion>3.5</ProjectVersion>
  • 30. června 2009 12:09Orlanzo Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     
    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
  • 14. července 2009 22:51Jill McClenahanMSFTUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     

    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

  • 4. srpna 2009 17:46Barclay HillMSFT, ModerátorUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     
    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.
  • 24. srpna 2009 22:36Barclay HillMSFT, ModerátorUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     
     

    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
  • 20. října 2009 17:49bjkj Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     

    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.

  • 20. října 2009 19:54tomsmiMSFTUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     
    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
  • 20. října 2009 20:22bjkj Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     
    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?
  • 21. října 2009 17:35Christian WhiteheadMSFTUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     
    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
  • 21. října 2009 19:51bjkj Uživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaileUživatelské medaile
     
    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.