none
Object reference not set error when registering database as Data Tier Application. RRS feed

  • Question

  • Hello All,

    I have been trying to register an existing database as a Data Tier Application in SQL Server 2014 but each time I try it fails with an object reference not set to an instance of an object. (Microsoft.Data.Tools.Schema.SQL) message.

    The strange aspect of this problem is that I can successfully register the database as a Data Tier Application in SQL Server 2012 and SQL Server 2008 R2.

    Has support for an object or feature been dropped between versions that may cause this error, if so how do I find out which part of the database is causing the problem?  If not, what else can I do to get to the bottom of this problem?

    Many thanks,

    Gurbhajan.


    • Edited by Gurbhajan Saturday, October 11, 2014 12:22 PM
    Saturday, October 11, 2014 12:21 PM

Answers

  • Hello Kevin,

    Thanks for your prompt reply.

    I have been attempting to register the database using SSMS.  So following your recommendation I downloaded and installed the latest version of the DAC Framework and tried again but was unsuccessful, the same error occurred.

    However, a colleague and I stripped the database down and recreated it piece by piece attempting to register the data tier after adding back a new piece within the database.  After some rather tedious work we managed to narrow the problem down to a single Table Valued Function that called a scalar UDF in its WHERE clause. 

    We have fixed  our function to work around the registering problem and I shall open a connect bug so you or your team can investigate this matter further.

    Thanks again,

    Gurbhajan 

    Tuesday, October 14, 2014 10:23 AM

All replies

  • Hi Gurbhajan. How are you running registration - via SSMS, SSDT, or SqlPackage.exe? The main recommendation I would give you is to install the latest DacFx code into the application you are using:

    - SSMS or SqlPackage.exe, download the latest Data-Tier Application Framework MSI and install this.

    - For SSDT, update to the latest version. Information is here, please note the update process is different for VS2013 (built in via Tools ->Extensions and Updates) and VS2012.

    We fixed a bug that would cause this related to Table Valued Functions in the most recent release. However if installing the latest tooling doesn't fix your issue, I'd suggest capturing the event log for what is going wrong and then opening a connect bug for this issue at https://connect.microsoft.com/SQLServer/feedback/CreateFeedback.aspx and use the category "Developer Tools(SSDT, BIDS, etc.)". We're trying to track all bugs through connect so that you can tell when we have fixed the issue and we can request more information. Please include the event log (instructions on this below) plus any other useful information you can provide, such as an example of exact steps to reproduce the problem.

     

    Gathering an Event Log for SSDT

    For diagnostic purposes we would like you to gather an event log for the issue that you are experiencing in SSDT. In order to gather a log and send it to a member of the team, please follow the steps below.

     

    1. Open a new command prompt as Administrator.
    2. Run the following command

    logman create trace -n DacFxDebug -p "Microsoft-SQLServerDataTools" 0x800 -o "%LOCALAPPDATA%\DacFxDebug.etl" -ets

    logman create trace -n SSDTDebug -p "Microsoft-SQLServerDataToolsVS" 0x800 -o "%LOCALAPPDATA%\SSDTDebug.etl" -ets

    1. Run whatever the target/issue scenario is in SSDT.
    2. Go back to the command prompt and run the following commands

    logman stop DacFxDebug -ets

    logman stop SSDTDebug -ets

    1. The resulting ETL files will be located at %LOCALAPPDATA%\SSDTDebug.etl & %LOCALAPPDATA%\DacFxDebug.etl and can be navigated to using Windows Explorer.
    1. Please attach this file when creating the connect bug

     

    NOTE - These logs will only be used by Microsoft product team members in order to better diagnose the problem you are experiencing with SSDT and will not be shared elsewhere. If you want to make sure that there is no private information in your ETL file, the SSDTDebug.etl file can be opened and analyzed using the Windows Event Viewer.

    To do this, open the Windows Event Viewer application. In the right-hand panel, select Open Saved Log. Navigate to the location where you saved the log, open, and review the contents of the trace.

    Thanks,

    Kevin

    Monday, October 13, 2014 5:47 PM
    Moderator
  • Hello Kevin,

    Thanks for your prompt reply.

    I have been attempting to register the database using SSMS.  So following your recommendation I downloaded and installed the latest version of the DAC Framework and tried again but was unsuccessful, the same error occurred.

    However, a colleague and I stripped the database down and recreated it piece by piece attempting to register the data tier after adding back a new piece within the database.  After some rather tedious work we managed to narrow the problem down to a single Table Valued Function that called a scalar UDF in its WHERE clause. 

    We have fixed  our function to work around the registering problem and I shall open a connect bug so you or your team can investigate this matter further.

    Thanks again,

    Gurbhajan 

    Tuesday, October 14, 2014 10:23 AM