简体   繁体   English

发布SQL项目VS 2013时“对象引用未设置为对象的实例”

[英]“Object reference not set to an instance of an object” when publishing a sql project VS 2013

When I try to publish a SQL Project to a database (SQL server 2008 r2) from Visual Studio 2013, I get a dialog box saying 当我尝试从Visual Studio 2013将SQL Project发布到数据库(SQL Server 2008 r2)时,出现一个对话框

"Object reference not set to an instance of an object" 

and then the publish never finishes (the progress icon keeps spinning). 然后发布永远不会完成(进度图标不断旋转)。

VS 2013错误消息

When I click in the "Output" tab, I don't see any errors there. 当我单击“输出”选项卡时,在此看不到任何错误。 It says: 它说:

========== Build: 4 succeeded or up-to-date, 0 failed, 0 skipped ==========.

When I do a "Schema Compare" from VS 2013 between my project and the production database, I get the same error. 当我在项目和生产数据库之间执行VS 2013中的“架构比较”时,出现相同的错误。

Is there any way to track down how and why VS2013's Data Tools Operations is producing that error? 有什么方法可以追踪VS2013的数据工具操作如何以及为什么产生该错误?

I ran into this problem again. 我又遇到了这个问题。 My problem was that the definition of one of my table-valued functions in the server (the target server of the publish) had a SQLCmd parameter commented out: 我的问题是服务器(发布的目标服务器)中的表值函数之一的定义注释了一个SQLCmd参数:

CREATE FUNCTION MyProblematicFunc
(   
    @beg_date date,
    @end_date date
)
RETURNS TABLE 
AS
RETURN 
(
    SELECT  
        Name,
        Address,
        --,cast([$(DBreferenceFromVS)].[dbo].[ConvertNumToDate](NumericDate) as DATE) [Create Date] 
        -- ^^^^ This comment above was causing the error on publish and on schema comparison. I had to remove it in the server
    FROM  RandomTable

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当没有数据返回时,抛出“对象引用未设置为对象的实例” - “Object reference not set to an instance of an object” gets thrown when no data is returned SqlPackage 对象引用未设置为对象的实例 - SqlPackage Object reference not set to an instance of an object 是否可以在VS 2013的设置程序中修改SQL Server 2008 R2 Express的自动安装脚本? - Is it possible to modify the auto-install script for SQL Server 2008 R2 Express in the set up program for VS 2013? 启动sql依赖项时对象名称无效 - Invalid object name when starting the sql dependency SQL71501:触发器:[dbo].[TriggerName] 对 object [dbo].[TableName] 有未解析的引用 - SQL71501: Trigger: [dbo].[TriggerName] has an unresolved reference to object [dbo].[TableName] 如何在IIS 7上发布MVC 4项目 - How to Publishing MVC 4 Project on IIS 7 Excel 2010 VBA项目中的SQL Server管理对象(SMO)参考? - SQL Server Management Objects (SMO) Reference in Excel 2010 VBA Project? 设置变量时的SQL情况 - SQL case when set variable SQL Server:返回搜索包含字符串的对象时发现的对象的对象类型 - SQL Server: Return object type of the objects found when searching for objects containing a string SQL Server尝试访问用dbo创建的udf函数“无效的对象名称'dbo.Function_Client'。” - SQL server when try to access udf function created with dbo “Invalid object name 'dbo.Function_Client'.”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM