未启用 ASP.NET CLR

在运行我的应用程序时,我在新安装的 ASP.Net 和 SQL Server 上出现了以下错误:

 Execution of user code in the .NET Framework is disabled. Enable "clr enabled" configuration option

我试图通过运行以下命令来解决这个问题:

 use dasolPSDev;


sp_configure 'clr enabled', 1
go
RECONFIGURE
go
sp_configure 'clr enabled'
go

但后来我明白了:

 Msg 102, Level 15, State 1, Line 3
Incorrect syntax near 'sp_config
77102 次浏览

Try this

use dasolPSDev;


EXEC sp_configure 'clr enabled', 1
go
RECONFIGURE
go
EXEC sp_configure 'clr enabled'
go

Simplified version of jams' solution which worked for me (SQL Server 2012):

sp_configure 'clr enabled', 1
GO
RECONFIGURE
GO

Source: http://msdn.microsoft.com/en-us/library/ms254506%28v=vs.80%29.aspx

I tried with sp_configure @configname=clr_enabled, @configvalue=1

then restarted the sql server. it worked

I had a similar issue, but this works for me (SQL Server 2008 R2):

sp_configure 'clr enabled', 1
GO


RECONFIGURE
GO