/clr, /clrpure, /clrsafe, WinForm CodeDOM Error

Hi,
Have converted a working vs2013 project to vs2015 preview and then CTP, I get a parser error when the WinForm designer tries to redraw the form. The converted code runs and compiles fine both in debug and release modes, and it seems the CodeDOM is not
able to see the classes defined in one of the referenced assemblies, which in fact isolates the problem to the way the form designer tries to pull in these referenced assemblies. My impression was that the code has to be built using the /clrpure in particular
or /clrsafe, and the latter was the switch used for the project since vs2005. There are inquiries on the forum expressing the designer misbehavior if the switches are not accordingly used for the C++ projects. 
Now building the code with the same switch in vs2015 gives the warning that /clrpure is deprecated, and altering it to /clr or /clrsafe although all generate a running code with the winform behaving properly, does not resolve the WinForm designer error.
It is nice to know if there is a workaround for this, or a way to step within the designer code to find out exactly what the cause of error could be, using the debugger. The call stack only shows the calls within the visual studio assemblies, and testing
hypothetical workarounds for a large size project is not that feasible either.
Best Regards,
AliReza Bemanian, Ph.D.

Hi,
Thanks for the provided steps and precautions so well described within your email. Unfortunately I had followed those steps earlier, even generated a new solution and added the projects one by one, cleared individual components and libraries, moved around
code segments always by making sure the designer generated pragma region has been left intact.  Still, I get a single CodeDom error complaining one of the dll classes is not found.
The dll links properly with the rest of the code, and the generated exe works fine with no problem at all. The Win Form initialization routines are all placed within the code modules with the only exception of the WinForm constructor still left within the
header file, which I will try to move it to the code module and try it tomorrow. Honestly I do not think this would make a difference either.
The only exception between the project generating the error by the CodeDom and the rest is the use of DataSets. The project generates a rather large data set header file, more than twelve thousand lines of code, where I noticed even for the VS2013 there
is no namespaces to contain the defined classes at all. VS2015 utilizes a single namespace scope within the header file, but I do not understand why for every defined namespace class,  the namespace name with two columns are again used. This is for
every single definition within the header file or the namespace. Obviously there is nothing wrong with this and we used to do it sporadically to clear rare compiler misinterpretations.
Now the problem is this that the CodeDom does not show not only the class name which is not visible to the form designer but the name prefixed by the namespace , or NameSpace.ClassName. The generated DataSet header file also shows the definitions as expressed
above, all prefixed with the namespace name. although all are depicted by IDE as errors with the red underlines. If I do a code peek for these underlined error elements the error gets cleared for that single individual until the code is rebuild again.
Even I removed all the prefixes  and was able to build the code successfully, more than 800 instances. The solution ran fine again with the exception of the Win Form designer generating the same error and incapable of redrawing the form.
That is why I mentioned  earlier, "it seems the CodeDOM is not able to see the classes defined in one of the referenced assemblies". Just speculating either the CodeDom does not expect the namespace prefix or it adds an extra one make it
unusable.
I tried to convey some of my key understandings of the problem. Knowing this is only a beta version, may be I tried to port the project a bit too early, but I was really impressed and drawn into it as soon as I realized the rich newly added features
and capabilities to the VS2015, and despite the invested time  this far, would still look for a solution or may be a service update to make these tasks a bit easier soon.
Best Regards,
AliReza Bemanian, Ph.D.

Similar Messages

  • WinForms ElementHost error while loading a WPF UserControl

    I'm programming a winforms application where I need to host a WPF UserControl in an System.Windows.Forms.Integration.ElementHost. After 2 weeks succesfull coding and debuging with no problem at all, today when I try to load a WPF UserControl into an ElementHost
    in the Visual Studio designer, I keep getting the following error message: "Error setting value "WindowsApplication1.UserControl1' to property 'Child'. Details: Loading this assembly would produce a different grant set from other instances (Exception
    from HRESULT: 0x80131401)"
    If I open a Form where in the past days I succesfully configured the ElementHost with the correct WPF UserControl, the Visual Studio designer shows the following errors:
    Object reference not set to an instance of an object.
    at System.ComponentModel.ReflectPropertyDescriptor.SetValue(Object component, Object value)
    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializePropertyAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement, CodePropertyReferenceExpression propertyReferenceEx, Boolean reportError)
    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement)
    at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)
    The Windows event viewer shows errors like:
    The data provider '{088ec962-3536-42b9-8b7a-9973ac1e3df7}' references a factory service '{4BD2E9CE-FDD9-497b-A30A-D8FAFA777E60}' that is provided by a package '{1247eee5-87cb-42f7-b5f0-b397168892ab}' that is not registered
    or
    The data source '{d69f3363-0923-41f4-84f9-b72f7fb66682}' specifies no supporting providers or a set that are not registered.
    I tried already to install Visual Studio again: no success.
    I'm using MS Visual Studio 2012 Professional, Update 4 (11.0.61030.00), target .NET framework 4, Windows 7 Professional.
    Any idea of what's going on? Do I need to re-install Visual Studio?
    Thank you in advance
    pg

    Hi pgmo,
    In Visual Stdio, We called this error WSOD.
    You could try the following suggestion.
    1) Close VS and delete the obj and bin directories in the project folder. then open VS, try again.
    2) If the first is not working,
    You could refer to the following discussions about avoid WSODs in VS designer.
    1.http://www.codeproject.com/Articles/13584/How-to-avoid-WSODs-in-the-Visual-Studio-Desig
    2.https://social.msdn.microsoft.com/Forums/windows/en-US/4ceb2dd3-c760-495f-83e6-1bf2a54fda93/designer-errors-object-reference-not-set-to-an-instance-of-an-object?forum=winformsdesigner
    3.http://stackoverflow.com/questions/4346504/winform-custom-control-why-object-reference-not-set-to-an-instance-of-an-object
    If you have any other concern regarding this issue, please feel free to let me know.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • PowerShell - scripting - skip Encrypted\CLR Stored Procedures

    Hi all,
    Forgot where I got the code below from but, how would I skip Encrypted\CLR procedures because, I get error below...
    Message
    Executed as user: Loginname A job step received an error at line 81 in a PowerShell script. The corresponding line is '
    $MyScripter.Script($proc)|out-null'. Correct the script and reschedule the job. The error information returned by PowerShell is: 'Exception calling "Script" with "1" argument(s): "The StoredProcedure '[dbo].[myrpocname]'
    cannot be scripted as its data is not accessible."  '.  Process Exit Code -1.  The step failed.
    #STORED PROCEDURES
    if($procs -ne $null)
    foreach ($proc in $procs)
    #Assuming that all non-system stored procs have proper naming convention and don''t use prefixes like "sp_"
    if ( $proc.Name.IndexOf("sp_") -eq -1 -and $proc.Name.IndexOf("xp_") -eq -1 -and $proc.Name.IndexOf("dt_") -eq -1)
    $fileName = $proc.name
    "Scripting SP $fileName"
    $scriptfile = "$rootDrive\DatabaseScripts\$sqlDatabaseName\$strDate\StoredProcedures\$filename.sql"
    New-Item $rootDrive\DatabaseScripts -type directory -force | out-null
    New-Item $rootDrive\DatabaseScripts\$sqlDatabaseName -type directory -force | out-null
    New-Item $rootDrive\DatabaseScripts\$sqlDatabaseName\$strDate -type directory -force | out-null
    New-Item $rootDrive\DatabaseScripts\$sqlDatabaseName\$strDate\StoredProcedures -type directory -force | out-null
    # SetScriptOptions
    $MyScripter.Options.FileName = $scriptfile
    #AppendTofile has to be ''true'' in order that all the procs'' scripts will be appended at the end
    $MyScripter.Options.AppendToFile = "true"
    $MyScripter.Script($proc)|out-null
    Thanks
    gv
    Sword

    You can exclude encrypted stored procedure using $_.IsEncrypted member.
    $storedProcs = $db.StoredProcedures | Where-object { $_.schema -eq $schema -and -not $_.IsSystemObject -and  -not $_.IsEncrypted}
    $server = "localhost"
    $database = "PowerSQL"
    $output_path = "F:\PowerSQL\"
    $schema = "dbo"
    $storedProcs_path = "$output_path\StoredProcedure\"
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | out-null
    $srv = New-Object "Microsoft.SqlServer.Management.SMO.Server" $server
    $db = New-Object ("Microsoft.SqlServer.Management.SMO.Database")
    $tbl = New-Object ("Microsoft.SqlServer.Management.SMO.Table")
    $scripter = New-Object ("Microsoft.SqlServer.Management.SMO.Scripter") ($server)
    # Get the database and table objects
    $db = $srv.Databases[$database]
    $storedProcs = $db.StoredProcedures | Where-object { $_.schema -eq $schema -and -not $_.IsSystemObject -and -not $_.IsEncrypted}
    # Set scripter options to ensure only data is scripted
    $scripter.Options.ScriptSchema = $true;
    $scripter.Options.ScriptData = $false;
    #Exclude GOs after every line
    $scripter.Options.NoCommandTerminator = $false;
    $scripter.Options.ToFileOnly = $true
    $scripter.Options.AllowSystemObjects = $false
    $scripter.Options.Permissions = $true
    $scripter.Options.DriAllConstraints = $true
    $scripter.Options.SchemaQualify = $true
    $scripter.Options.AnsiFile = $true
    $scripter.Options.EnforceScriptingOptions = $true
    function CopyObjectsToFiles($objects, $outDir) {
    if (-not (Test-Path $outDir)) {
    [System.IO.Directory]::CreateDirectory($outDir)
    foreach ($o in $objects) {
    if ($o -ne $null) {
    $schemaPrefix = ""
    if ($o.Schema -ne $null -and $o.Schema -ne "") {
    $schemaPrefix = $o.Schema + "."
    $scripter.Options.FileName = $outDir + $schemaPrefix + $o.Name + ".sql"
    Write-Host "Writing " $scripter.Options.FileName -ErrorAction silentlycontinue
    $scripter.EnumScript($o)
    # Output the scripts
    CopyObjectsToFiles $storedProcs $storedProcs_path
    Write-Host "Finished at" (Get-Date)
    -Prashanth

  • XAML DataContext: name does not exist in the namespace

    I have created a new C# WPF Application project in VS 2013, named dataconfigtest.  The namespace is dataconfigtest.
    I add a new, public class named "TestDataClass".  It is also in the dataconfigtest namespace.
    I add the following code to the XAML file (MainWindow.xaml) in the <Window> section:
    xmlns:local="clr-namespace:dataconfigtest"
    I then define the datacontext as follows:
    <Window.DataContext>
    <local:TestDataClass />
    </Window.DataContext>
    When I build the project, I receive the following error:
    The name "TestDataClass" does not exist in the namespace "clr-namespace:dataconfigtest"
    I have tried:
    closing/opening VS
    removing/adding the project
    creating a fresh project
    cleaning and rebuilding
    including the assembly information in the XAML "local" namespace definition
    Note that I can set the datacontext in the C# code-behind.  It's only in the XAML that I have problems.
    Thank you for any help!
    EDIT: I opened the same VS project file on a different computer and it worked.  I will try repairing my installation of VS.
    EDIT2: I have repaired the installation and rebooted.  Same issue.  I will try re-installing VS.

    Hi Qubert,
    >>The name "TestDataClass" does not exist in the namespace "clr-namespace:dataconfigtest"
    From this error message,i think that your namespace could be incorrect or you need to rebuild the project.
    This is my code snippets:
    <Window x:Class="dataconfigtest.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:dataconfigtest"
    Title="MainWindow" Height="350" Width="525">
    <Window.DataContext>
    <local:TestDataClass></local:TestDataClass>
    </Window.DataContext>
    <Grid>
    </Grid>
    </Window>
    public class TestDataClass
    public string data { get; set; }
    >>EDIT: I opened the same VS project file on a different computer and it worked.  I will try repairing my installation of VS.
    In my experience,your environment might be some problems, So please feel free to tell me the result of  repairing your VS.

  • SCCM 2012 SP1 Report Permissions required

    Hello Everyone.. Im having trouble running any reports off of the SCCM Console. So far I have full permissions in the SCCM console, and on SQL Server I am a sysadmin. Here is my error when I run it through report builder:
    System.Web.Services.Protocols.SoapException: The permissions granted to user 'DTTLA\eguerrero' are insufficient for performing this operation. ---> Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: The permissions granted to user 'DTTLA\eguerrero' are insufficient for performing this operation.   at Microsoft.ReportingServices.Library.ReportingService2010Impl.CreateReportEditSession(String Report, String Parent, Byte[] Definition, String& EditSessionID, Warning[]& Warnings)   at Microsoft.ReportingServices.WebServer.ReportingService2010.CreateReportEditSession(String Report, String Parent, Byte[] Definition, String& EditSessionID, Warning[]& Warnings)----------------------------The permissions granted to user 'DTTLA\eguerrero' are insufficient for performing this operation.
    And here is the error when I run it through the Configuration Manager:
    Microsoft.Reporting.WinForms.ReportServerExceptionAn error has occurred during report processing. (rsProcessingAborted)Stack Trace:   at Microsoft.Reporting.WinForms.ServerReport.ServerUrlRequest(Boolean isAbortable, String url, Stream outputStream, String& mimeType, String& fileNameExtension)   at Microsoft.Reporting.WinForms.ServerReport.InternalRender(Boolean isAbortable, String format, String deviceInfo, NameValueCollection urlAccessParameters, Stream reportStream, String& mimeType, String& fileNameExtension)   at Microsoft.Reporting.WinForms.AsyncMainStreamRenderingOperation.RenderServerReport(ServerReport report)   at Microsoft.Reporting.WinForms.AsyncRenderingOperation.PerformOperation()   at Microsoft.Reporting.WinForms.ReportViewer.AsyncReportOperationWrapper.PerformOperation()   at Microsoft.Reporting.WinForms.ProcessingThread.ProcessThreadMain(Object arg)-------------------------------Microsoft.Reporting.WinForms.ReportServerExceptionCannot impersonate user for data source 'AutoGen__5C6358F2_4BB6_4a1b_A16E_8D96795D8602_'. (rsErrorImpersonatingUser)Stack Trace:   at Microsoft.Reporting.WinForms.ServerReport.ServerUrlRequest(Boolean isAbortable, String url, Stream outputStream, String& mimeType, String& fileNameExtension)   at Microsoft.Reporting.WinForms.ServerReport.InternalRender(Boolean isAbortable, String format, String deviceInfo, NameValueCollection urlAccessParameters, Stream reportStream, String& mimeType, String& fileNameExtension)   at Microsoft.Reporting.WinForms.AsyncMainStreamRenderingOperation.RenderServerReport(ServerReport report)   at Microsoft.Reporting.WinForms.AsyncRenderingOperation.PerformOperation()   at Microsoft.Reporting.WinForms.ReportViewer.AsyncReportOperationWrapper.PerformOperation()   at Microsoft.Reporting.WinForms.ProcessingThread.ProcessThreadMain(Object arg)-------------------------------Microsoft.Reporting.WinForms.ReportServerExceptionLog on failed. Ensure the user name and password are correct. (rsLogonFailed)Stack Trace:   at Microsoft.Reporting.WinForms.ServerReport.ServerUrlRequest(Boolean isAbortable, String url, Stream outputStream, String& mimeType, String& fileNameExtension)   at Microsoft.Reporting.WinForms.ServerReport.InternalRender(Boolean isAbortable, String format, String deviceInfo, NameValueCollection urlAccessParameters, Stream reportStream, String& mimeType, String& fileNameExtension)   at Microsoft.Reporting.WinForms.AsyncMainStreamRenderingOperation.RenderServerReport(ServerReport report)   at Microsoft.Reporting.WinForms.AsyncRenderingOperation.PerformOperation()   at Microsoft.Reporting.WinForms.ReportViewer.AsyncReportOperationWrapper.PerformOperation()   at Microsoft.Reporting.WinForms.ProcessingThread.ProcessThreadMain(Object arg)-------------------------------Microsoft.Reporting.WinForms.ReportServerExceptionThe user name or password is incorrectStack Trace:   at Microsoft.Reporting.WinForms.ServerReport.ServerUrlRequest(Boolean isAbortable, String url, Stream outputStream, String& mimeType, String& fileNameExtension)   at Microsoft.Reporting.WinForms.ServerReport.InternalRender(Boolean isAbortable, String format, String deviceInfo, NameValueCollection urlAccessParameters, Stream reportStream, String& mimeType, String& fileNameExtension)   at Microsoft.Reporting.WinForms.AsyncMainStreamRenderingOperation.RenderServerReport(ServerReport report)   at Microsoft.Reporting.WinForms.AsyncRenderingOperation.PerformOperation()   at Microsoft.Reporting.WinForms.ReportViewer.AsyncReportOperationWrapper.PerformOperation()   at Microsoft.Reporting.WinForms.ProcessingThread.ProcessThreadMain(Object arg)-------------------------------
    Does anyone have an idea where I'm forgetting to assign permissions?

    Check the properties of your Reporting Point. See the user that is configured to connect to the data source. This user must have a SQL login (eg sysadmin)
    See here
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/dc47c82b-41aa-4b6a-990f-0c0264aa33a2/error-message-when-trying-to-open-reports-on-the-sccm-2012-console-and-ie-browser-sql-server-2008
    Gerry Hampson | Blog:
    www.gerryhampsoncm.blogspot.ie | LinkedIn:
    Gerry Hampson | Twitter:
    @gerryhampson

  • Calling web service from SQL 2008 error: System.Security.HostProtectionException: Attempted to perform an operation that was forbidden by the CLR host.

    Hi, 
    Im trying to use web service in c# sql database project. when running stored procedure, in which the web service should be called, im getting this error:
    System.TypeInitializationException: The type initializer for 'System.ServiceModel.ClientBase`1' threw an exception. ---> System.Security.HostProtectionException: Attempted to perform an operation that was forbidden by the CLR host.
    at System.ServiceModel.DiagnosticUtility.GetUtility()
    at System.ServiceModel.DiagnosticUtility.get_Utility()
    at System.ServiceModel.ClientBase`1..cctor()
    The protected resources (only available with full trust) were:
    All
    The demanded resources were:
    Synchronization, ExternalThreading
    --- End of inner exception stack trace ---
    at System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef()
    at System.ServiceModel.ClientBase`1..ctor()
    at UMGClient..ctor()
    at UMG_StoredProcedures.spUMG_ProcessEmail(SqlInt64 cid_request)
    Here is the code:
    using System;
    using System.Data;
    using System.Data.SqlClient;
    using System.Data.SqlTypes;
    using Microsoft.SqlServer.Server;
    using CredexDB.Workflow;
    using System.Collections.Generic;
    using CredexDB.umgwcftest;
    public partial class UMG_StoredProcedures
    /// <summary>
    /// </summary>
    /// <param name="bankDate"></param>
    /// <param name="stateCategory"></param>
    [Microsoft.SqlServer.Server.SqlProcedure]
    public static void spUMG_ProcessEmail( SqlInt64 cid_request )
    SqlConnection conn = new SqlConnection("Context Connection=true;");
    conn.Open();
    try
    SqlContext.Pipe.Send("A");
    UMGClient umgcl = new UMGClient();
    SqlContext.Pipe.Send("B");
    UMGwcf.SoapExchangeMailMessage email = new UMGwcf.SoapExchangeMailMessage();
    string[] names = new string[1];
    names[0] = "[email protected]";
    email.To = names;
    email.Subject = "Test UmgWcf";
    email.MessageBody = "Testovacia správa - ľľššččťťťýéáí";
    email.From = "[email protected]";
    email.Priority = 20;
    email.Sender = 1;
    email.DoNotArchive = false;
    email.EncryptAndSign = false;
    //long ret = umgcl.SendMailMessage(email);
    catch (Exception e)
    SqlContext.Pipe.Send("C");
    SqlContext.Pipe.Send(e.ToString());
    finally
    SqlContext.Pipe.Send("D");
    conn.Close();
    private static void execSql(string sql, SqlConnection conn)
    new SqlCommand(sql, conn).ExecuteNonQuery();
    The error occurs at this row:
    UMGClient umgcl = new UMGClient();
    Here is the UMG class:
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    [System.ServiceModel.ServiceContractAttribute(Namespace="vub.sk/UMGwcf", ConfigurationName="IUMG")]
    public interface IUMG
    [System.ServiceModel.OperationContractAttribute(Action="vub.sk/UMGwcf/IUMG/SendMailMessage", ReplyAction="vub.sk/UMGwcf/IUMG/SendMailMessageResponse")]
    long SendMailMessage(UMGwcf.SoapExchangeMailMessage message);
    [System.ServiceModel.OperationContractAttribute(Action="vub.sk/UMGwcf/IUMG/ResendEmailMessage", ReplyAction="vub.sk/UMGwcf/IUMG/ResendEmailMessageResponse")]
    long ResendEmailMessage(long emailid);
    [System.ServiceModel.OperationContractAttribute(Action="vub.sk/UMGwcf/IUMG/GetEmailById", ReplyAction="vub.sk/UMGwcf/IUMG/GetEmailByIdResponse")]
    UMGwcf.SoapDeliveredMailMessage GetEmailById(long emailid);
    [System.ServiceModel.OperationContractAttribute(Action="vub.sk/UMGwcf/IUMG/SendSMSMessage", ReplyAction="vub.sk/UMGwcf/IUMG/SendSMSMessageResponse")]
    long SendSMSMessage(UMGwcf.SoapSMSMessage smsmessage);
    [System.ServiceModel.OperationContractAttribute(Action="vub.sk/UMGwcf/IUMG/GetSMSById", ReplyAction="vub.sk/UMGwcf/IUMG/GetSMSByIdResponse")]
    UMGwcf.SoapDeliveredSMSMessage GetSMSById(long smsid);
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    public interface IUMGChannel : IUMG, System.ServiceModel.IClientChannel
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
    public partial class UMGClient : System.ServiceModel.ClientBase<IUMG>, IUMG
    public UMGClient()
    public UMGClient(string endpointConfigurationName) :
    base(endpointConfigurationName)
    public UMGClient(string endpointConfigurationName, string remoteAddress) :
    base(endpointConfigurationName, remoteAddress)
    public UMGClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
    base(endpointConfigurationName, remoteAddress)
    public UMGClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
    base(binding, remoteAddress)
    public long SendMailMessage(UMGwcf.SoapExchangeMailMessage message)
    return base.Channel.SendMailMessage(message);
    public long ResendEmailMessage(long emailid)
    return base.Channel.ResendEmailMessage(emailid);
    public UMGwcf.SoapDeliveredMailMessage GetEmailById(long emailid)
    return base.Channel.GetEmailById(emailid);
    public long SendSMSMessage(UMGwcf.SoapSMSMessage smsmessage)
    return base.Channel.SendSMSMessage(smsmessage);
    public UMGwcf.SoapDeliveredSMSMessage GetSMSById(long smsid)
    return base.Channel.GetSMSById(smsid);
    the CLR where created as follows:
    ALTER DATABASE XXXX SET TRUSTWORTHY ON;
    CREATE ASSEMBLY [System.ServiceModel]
    FROM 'C:\ttrojcak\System.Runtime.Serialization.dll'
    WITH PERMISSION_SET = UNSAFE
    CREATE ASSEMBLY [System.ServiceModel]
    FROM 'C:\ttrojcak\System.ServiceModel.dll'
    WITH PERMISSION_SET = UNSAFE
    the message window shows warnings:
    Warning: The Microsoft .NET Framework assembly 'system.servicemodel, version=3.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
    Warning: The Microsoft .NET Framework assembly 'system.web, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=x86.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
    Warning: The Microsoft .NET Framework assembly 'system.drawing, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
    Warning: The Microsoft .NET Framework assembly 'system.directoryservices, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
    Warning: The Microsoft .NET Framework assembly 'system.directoryservices.protocols, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
    Warning: The Microsoft .NET Framework assembly 'system.enterpriseservices, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=x86.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
    Warning: The Microsoft .NET Framework assembly 'system.runtime.remoting, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
    Warning: The Microsoft .NET Framework assembly 'system.runtime.serialization.formatters.soap, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
    Warning: The Microsoft .NET Framework assembly 'system.design, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
    Warning: The Microsoft .NET Framework assembly 'system.windows.forms, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
    Warning: The Microsoft .NET Framework assembly 'accessibility, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
    Warning: The Microsoft .NET Framework assembly 'system.drawing.design, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
    Warning: The Microsoft .NET Framework assembly 'system.web.regularexpressions, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
    Warning: The Microsoft .NET Framework assembly 'system.serviceprocess, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
    Warning: The Microsoft .NET Framework assembly 'system.configuration.install, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
    Warning: The Microsoft .NET Framework assembly 'system.identitymodel, version=3.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
    Warning: The Microsoft .NET Framework assembly 'system.messaging, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
    Warning: The Microsoft .NET Framework assembly 'system.identitymodel.selectors, version=3.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
    Warning: The Microsoft .NET Framework assembly 'microsoft.transactions.bridge, version=3.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=msil.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
    creating store procedure:
    EXEC sp_executesql N'
    CREATE PROCEDURE [spUMG_ProcessEmail]
    @cid_request bigint
    AS
    EXTERNAL NAME [CredexDB].[UMG_StoredProcedures].[spUMG_ProcessEmail]'
    IF (@@ERROR = 0)
    BEGIN
    DECLARE @procSchema sysname
    DECLARE @procName sysname
    SELECT @procSchema = SCHEMA_NAME(schema_id), @procName = name
    FROM sys.objects
    WHERE object_id = OBJECT_ID(N'[spUMG_ProcessEmail]')
    EXEC sp_addextendedproperty 'AutoDeployed', N'yes',
    'SCHEMA', @procSchema,
    'PROCEDURE', @procName
    EXEC sp_addextendedproperty 'SqlAssemblyFile', N'UMG\UMG.cs',
    'SCHEMA', @procSchema,
    'PROCEDURE', @procName
    EXEC sp_addextendedproperty 'SqlAssemblyFileLine', 95,
    'SCHEMA', @procSchema,
    'PROCEDURE', @procName
    END
    Any tips? 
    Thank you

    and this moves me to another problem. the stored procedure spUMG_ProcessEmail is unable to find and read app.config
    stored procedure is unable to read app.config. it is necesary to rewrite the xml config into c# code:
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <system.serviceModel>
    <bindings>
    <basicHttpBinding>
    <binding name="BasicHttpBinding_IUMG" closeTimeout="00:01:00"
    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
    useDefaultWebProxy="true">
    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
    <security mode="None">
    <transport clientCredentialType="None" proxyCredentialType="None"
    realm="" />
    <message clientCredentialType="UserName" algorithmSuite="Default" />
    </security>
    </binding>
    </basicHttpBinding>
    </bindings>
    <client>
    <endpoint address="http://umgwcftest/UMGwcf.svc" binding="basicHttpBinding"
    bindingConfiguration="BasicHttpBinding_IUMG" contract="IUMG"
    name="BasicHttpBinding_IUMG" />
    </client>
    </system.serviceModel>
    </configuration>
    and the rewrited code:
    BasicHttpBinding myBinding = new BasicHttpBinding();
    myBinding.Name = "BasicHttpBinding_IUMG";
    myBinding.CloseTimeout = new TimeSpan(00, 01, 00);
    myBinding.OpenTimeout = new TimeSpan(00, 01, 00);
    myBinding.ReceiveTimeout = new TimeSpan(00, 10, 00);
    myBinding.CloseTimeout = new TimeSpan(00, 01, 00);
    myBinding.AllowCookies = false;
    myBinding.BypassProxyOnLocal = false;
    myBinding.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;
    myBinding.MaxBufferSize = 65536;
    myBinding.MaxBufferPoolSize = 524288;
    myBinding.MaxReceivedMessageSize = 65536;
    myBinding.MessageEncoding = WSMessageEncoding.Text;
    myBinding.TextEncoding = System.Text.Encoding.UTF8;
    myBinding.TransferMode = TransferMode.Buffered;
    myBinding.UseDefaultWebProxy = true;
    myBinding.ReaderQuotas.MaxDepth = 32;
    myBinding.ReaderQuotas.MaxStringContentLength = 8192;
    myBinding.ReaderQuotas.MaxArrayLength = 16384;
    myBinding.ReaderQuotas.MaxBytesPerRead = 4096;
    myBinding.ReaderQuotas.MaxNameTableCharCount = 16384;
    myBinding.Security.Mode = BasicHttpSecurityMode.None;
    myBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
    myBinding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None;
    myBinding.Security.Transport.Realm = "";
    myBinding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;
    myBinding.Security.Message.AlgorithmSuite = System.ServiceModel.Security.SecurityAlgorithmSuite.Default;
    EndpointAddress endPointAddress = new EndpointAddress(new Uri("http://umgwcftest/UMGwcf.svc"));
    SqlContext.Pipe.Send("2");
    UMGClient umgcl = new UMGClient(myBinding, endPointAddress);
    after that, I got another error and it's solution is here:
    error and solution
    So I got it finaly working 

  • Error in CLR assembly after migrating to SQL server 2012

    We moved to SQL Server 2012 from 2008R2 and I am unable to get the CLR assembly working.  I have read several topics about trustworthy setting and a mismatch dbo SID. I checked the SID and everything looks good and the 2008R2 server works fine with
    Trustworthy set to OFF.  I'm starting to think it is a .NET issue.  2008R2 works with 2.0 and 2012 uses 4.0 and i'm wondering if just redeploying the assembly will fix the problem.  Any suggestions would be greatly appreciated. 
    Msg 10314, Level 16, State 11, Procedure MP_ExportXYToCSV2, Line 41
    An error occurred in the Microsoft .NET Framework while trying to load assembly id 65540. The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE. Run the query again, or check documentation
    to see how to solve the assembly trust issues. For more information about this error:
    System.IO.FileLoadException: Could not load file or assembly 'exporttocsv, Version=1.0.4780.25878, Culture=neutral, PublicKeyToken=f5567e386ca8280d' or one of its dependencies. An error relating to security occurred. (Exception from HRESULT: 0x8013150A)
    System.IO.FileLoadException:
       at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection,
    Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection,
    Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
       at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
       at System.Reflection.Assembly.Load(String assemblyString)

    It is not clear what you have done, for an assembly with a permission set beyond SAFE to work, one of these conditions must be set:
    1) The database is trustworthy and the database owner has EXTERNAL ACCESS ASSEMBLY or UNSAFE ASSEMBLY permission, depending on the permission set for the assembly.
    2) The assembly is a signed with a key, and that key exists in the master database. A login has been created from the key, and this login has been granted the matching assembly permission.
    Since you say that it worked on SQL 2008 R2 without trustworthy, I would assume that you had a key-login pair on the old server, but forgot to move them to the new server.
    Don't set the database trustworthy. This is a potential security risk.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Error in CLR: InvalidOperationException - The current type is an interface and cannot be constructed. Are you missing a type mapping?

    Hi, I'm trying to execute a .NET assembly's method from SQL Server 2012 Express, but I'm stuck with this error calling the sp:
    Microsoft.Practices.ServiceLocation.ActivationException: Activation error occured while trying to get instance of type ISymmetricCryptoProvider, key "TripleDESCryptoServiceProvider" ---> Microsoft.Practices.Unity.ResolutionFailedException:
    Resolution of the dependency failed, type = "Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.ISymmetricCryptoProvider", name = "TripleDESCryptoServiceProvider".
    Exception occurred while: while resolving.
    Exception is: InvalidOperationException - The current type, Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.ISymmetricCryptoProvider, is an interface and cannot be constructed. Are you missing a type mapping?
    At the time of the exception, the container was:
      Resolving Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.ISymmetricCryptoProvider,TripleDESCryptoServiceProvider
     ---> System.InvalidOperationException: The current type, Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.ISymmetricCryptoProvider, is an interface and cannot be constructed. Are you missing a type mapping?
    System.InvalidOperationException:
       en Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.ThrowForAttemptingToConstructInterface(IBuilderContext context)
       en BuildUp_Microsoft.Practices.EnterpriseLibrary.Security
    Microsoft.Practices.ServiceLocation.ActivationException:
       en Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
       en Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance[TService](String key)
       en Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Cryptographer.GetSymmetricCryptoProvider(String symmetricInstance)
       en Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Cryptographer.DecryptSymmetric(String symmetricInstance, String ciphertextBase64)
       en ...
    Is there any limitation by design for Interface instantiation from CLR database?
    Any help I will appreciate, thanks a million!!

    Bob, thanks for your response.. Yes, the code works fine outside of SQLCLR. This is the class I'm trying to instantiate, I'm using it to envolve Cryptographer, an Enterprise Library 5.0 class actually, so I have no control to test it without referring the
    interface.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.Practices.EnterpriseLibrary.Security.Cryptography;
    using System.Security.Cryptography;
    using Microsoft.SqlServer.Server;
    using System.Data.SqlTypes;
    namespace Cars.UtileriasGlobales.Helpers
        /// <summary>
        /// Clase que permite encriptar y desencriptar cadenas de textos utilizando
        /// TripleDESCryptoServiceProvider de Enterprise Library 5.0
        /// </summary>
        public static class Cryptography
            #region Metodos
            [SqlProcedure]
            public static void DesencriptarSQLServer(SqlString cadena, out SqlString cadenaDesencriptada)
                cadenaDesencriptada = !String.IsNullOrEmpty(cadena.ToString()) ? Cryptographer.DecryptSymmetric("TripleDESCryptoServiceProvider", cadena.ToString().Replace(" ", "+"))
    : String.Empty;
            #endregion
    I have collected all the dependent assemblies in one directory 'C:\migrate', so the create assembly finish ok. This is the script to create the assembly I'm using:
    sp_configure 'clr enable', 1
    GO
    RECONFIGURE
    GO
    ALTER DATABASE cars SET TRUSTWORTHY ON
    GO
    CREATE ASSEMBLY CryptographyEntLib5
    AUTHORIZATION dbo
    FROM 'C:\migrate\Cars.UtileriasGlobales.dll'
    WITH PERMISSION_SET = UNSAFE
    GO
    CREATE PROCEDURE usp_Desencriptar
    @cadena nvarchar(200),
    @cadenaDesencriptada nvarchar(MAX) OUTPUT
    AS EXTERNAL NAME CryptographyEntLib5.[Cars.UtileriasGlobales.Helpers.Cryptography].DesencriptarSQLServer
    GO
    DECLARE @msg nvarchar(MAX)
    EXEC usp_Desencriptar 'Kittu And Tannu',@msg output
    PRINT @msg

  • Deserialization permissions error in CLR stored procedure

    Environment: SQL Server 2008 R2 standard edition and VS2010, .Net Framework 3.5
    I've got a table with a varbinary column that contains a serialized Hashtable. I'm writing a CLR stored procedure that, given the contents of such a field from a row in the table, does a lookup on a key in the Hashtable. and returns the element's value.
    To get the Hashtable, I need to deserialize it, and it appears that the BinaryFormatter's Deserialize function requires certain permissions that I don't know how to grant.
    This SQL Server instance runs on my own development machine, and was installed pretty much with all defaults. I'm the owner.
    Any help on solving this? I should point out while I write a fair amount of SQL and a LOT of VB, I'm far from a SQL Server expert, so if you have suggestions I'd appreciate it if you'd spell things out clearly for me.
    Thanks in advance for any help,
    Tom
    Here's a fragment from the VB source:
        ' the bytes variable is defined as Byte()
        Dim ms As MemoryStream = New MemoryStream()
        ms.Write(bytes, 0, bytes.Length)
        ms.Seek(0, 0)
        Dim formatter As New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter()
        Dim oHT As Object = formatter.Deserialize(ms)    'hurls here
    The CREATE ASSEMBLY statement had WITH PERMISSION_SET = SAFE. I tried it with UNSAFE, and got this error:
    CREATE ASSEMBLY for assembly 'ddmi.deep.data.sqlserver' failed because assembly 'ddmi.deep.data.sqlserver' is not authorized for PERMISSION_SET = UNSAFE.  The assembly is authorized when either of the following is true: the database owner (DBO) has
    UNSAFE ASSEMBLY permission and the database has the TRUSTWORTHY database property on; or the assembly is signed with a certificate or an asymmetric key that has a corresponding login with UNSAFE ASSEMBLY permission.
    Here's an SQL script that runs it:
    declare
        @id int
      , @raw_req_bin varbinary(1500)
      , @value nvarchar(max)
    set @id = 327
    set @raw_req_bin = (select raw_req_bin from dp_payment where transaction_id = @id)
    set @value = dbo.dp_fx_hash_table_lookup(@raw_req_bin, 'first_name')
    and here's what I get when I run the script:
    SecurityExceptionSystem.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
       at System.Security.CodeAccessSecurityEngine.SpecialDemand(PermissionType whatPermission, StackCrawlMark& stackMark)
       at System.Security.CodeAccessPermission.DemandInternal(PermissionType permissionType)
       at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
       at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
       at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
       at ddmi.deep.data.sqlserver.UserDefinedFunctions.AsHashTable(Byte[] bytes, String& phase)
    The action that failed was:
    Demand
    The type of the first permission that failed was:
    System.Security.Permissions.SecurityPermission
    The Zone of the assembly that failed was:
    MyComputer

    Set the database (in a test system) to trustworthy (ALTER DATABSE foo SET TRUSTWORTHY ON) for testing. If this works, look into code signing (sign an assembly and catalog the cert/asymmetric key to master) for production. If you have problems with
    "native" serialization, you might get better results using XML serializers.
    Re: XML serializers. SQLCLR will not load dynamically generated serializers. So you need to pregenerate XML serializers with sgen.exe.
    Your specific error message (the permission error) might be fixed by cataloging the SQLCLR assembly as UNSAFE. If that doesn't work, you might attempt to change the .NET permission configuration on your machine using either of the tools described here:
    http://msdn.microsoft.com/en-us/library/7c9c2y1w(v=vs.90).aspx
    Hope this helps, Cheers, Bob

  • SQL Server 2005 64-bit & SQL CLR Stored Procedures using DI API. COM Error.

    Hi,
    We've created a set of SQL CLR Stored Procs in C# .NET which use the DI API to import data into SAP (DEV was carried out on 32-bit environment).
    The DLLs and Interop.SAPbobsCOM have been successfully deployed as assemblies on SQL Server with their permission set to UNSAFE on the following environment:
    Microsoft Windows Server 2003 R2 Standard Edition 64-bit, Service Pack 2
    Microsoft SQL Server 2005 - 9.00.3073.00 (X64)
    SAP Business One 2007 A (8.00.180) SP:00 PL:45
    When executing the SQL CLR Stored Procs from SQL Server Management Studio, the following error is returned:
    "Retrieving the COM class factory for component with CLSID {632F4591-AA62-4219-8FB6-22BCF5F62007} failed due to the following error: 80040154."
    From our understanding, this occurs because SQL Server loads the assemblies into it's 64-bit process space, whereas the SAPbobsCOM is 32-bit. Are we assuming correctly?
    What can be done to solve this problem?

    Hi Jeremy,
    I'd agree with your assumption that it's to do with your DLL running in a 64 bit process. When you build your project, try setting the build properties to use a X86 instruction set (ie 32 bit).
    More details here:
    Re: Addon Develeped on 32bit Install on 64bit
    I've never tried for a CLR stored procedure but this is how you get around the issue when running a DI API addon on a 64 bit machine so hopefully it will work if the dll is executed by SQL Server. Let us know how you get on.
    Kind Regards,
    Owen

  • Add IBM.Data.DB2.iSeries.Dll Assembly To SQL CLR Causes Errors

    I'm writing CLR procs against DB2. Code works as a standalone. When I try to add the IBM.Data.DB2.iSeries.dll as an assembly to my SQL Server database, I get the following error below. I can't find the assembly in the GAC on my server. What's the dependency
    chain for this dll?
    DJ Baby Anne's Biggest Fan................

    See this thread here: https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014548896
    You may need an updated driver from IBM.
    This error message means that a dependency of that DLL cannot be loaded.  SQL CLR has a different assembly loading mechanism than CLR running outside of SQL Server.  To make a dependent assembly available to SQL CLR you must install it in the database
    using the CREATE ASSEMBLY statement.  
    You should look for a version of this driver that doesn't have a dependency on this assembly, and install the assembly in the database only if you have to.
    David
    David http://blogs.msdn.com/b/dbrowne/

  • CLR error 80004005

    I installed a software on my sony vaio with OS windows 7. I ran the software but got CLR error:80004005. I have Microsoft .Net Framework 1.1, Microsoft
    .Net Framework 4 Client Profile, Microsoft .Net Framework 4 Extended . Any help will be greatly appreciated. thanks much I checked the temp file using %temp% and at the bottom it has  a file called windows 6.1 KB958488-V6001-X64. when I click on that
    it says error OX80070424. Can any one help please. It would be greatly appreciated. Thanks much 
    I have read all the solutions for this error message, but my problem seems different. can anyone help me please?

    Hi,
     You can check the Answer in this link and see what you can find.  8)
    CLR Error: 80004005 The program will now terminate
    If you say it can`t be done then i`ll try it

  • CLR.DLL error, empty data

    When I try to install the office 2010, the installation is stopped with a message of error 1935. Looking further I discovered that the clr.dll is in blank it´s with 0kb.
    I tryed to uninstall and re-install .net 4.0 and didn´t take effect.
    Another corrections like: 
    Open CMD as administrator type command:
    fsutil resource setautoreset true c:\
    It didn´t work out.
    Another try:
    HKEY_LOCAL_MACHINE
    System
    CurrentControlSet
    Control
    In control "created a new key called": RegistrySizeLimit
    Type=REG_DWORD
    With the value FFFFFFFF (4294967295)
    It didn´t work either.
    In my notebook the clr.dll has a total size of 11Mb. both are windows 8.1 pt-br 64x
    Please any suggestions? Ideias?
    Thx for the support!

    this is the complete step
    https://support.microsoft.com/kb/926804/en-us
    I suggest you repeat it again
    for further question I suggest you contact Office forum since this issue related to Office installation
    http://answers.microsoft.com/en-us/office

  • Error retrieving cache in c# WPF project (No problems in c# WinForms)

    Hi!
    To put it simply, the same basic cache retrival (with same configuration files) works under c# Winform app but under c# WPF app returns an error: {"unable to convert type -6 to a Binary type"} from cache.GetValues(null);
    Working with a custom .net object, under VS 2010 SP1, .net 4. Coherence 3.5.2.46302. Win XP SP3.
    Is there any known issue related to this? Any differences or specifics in serialization/deserialization for wpf vs winforms?
    It connects and sees number of records properly (cache.Count) but fails on GetEntries or GetValues.
    Details below:
    WPF c# code
    using System;
    using System.Collections.Generic;
    using System.Collections;
    using System.ComponentModel;
    using System.Data;
    using System.Linq;
    using System.Drawing;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    using RflxBlotter;
    using System.Configuration;
    using Tangosol.Net;
    using Tangosol.Net.Cache;
    using Tangosol.Net.Cache.Support;
    using Tangosol.Util;
    using Tangosol.Util.Extractor;
    using Tangosol.Util.Filter;
    namespace WPFGrid
        /// <summary>
        /// Interaction logic for MainWindow.xaml
        /// </summary>
        public partial class MainWindow : Window
            public MainWindow()
               InitializeComponent();
               Cohe();
             public void Cohe()
                INamedCache cache;
                long tradeCount;
                cache = CacheFactory.GetCache("trade-cache");
                tradeCount = cache.Count;
                ICollection cacheEntries = cache.GetValues(null);
    }InnerException: {"unable to convert type -6 to a Binary type"}
    Source: Coherence
    InnerStack:
    at Tangosol.IO.Pof.PofStreamReader.ReadString(Int32 index)
    at RflxBlotter.RflxTrade.ReadExternal(IPofReader reader)
    at Tangosol.IO.Pof.PortableObjectSerializer.Deserialize(IPofReader reader)
    at Tangosol.IO.Pof.PofStreamReader.ReadAsObject(Int32 typeId)
    at Tangosol.IO.Pof.PofStreamReader.ReadObject(Int32 index)
    at Tangosol.IO.Pof.ConfigurablePofContext.Deserialize(DataReader reader)
    at Tangosol.Net.Impl.RemoteNamedCache.ConverterFromBinary.Convert(Object o)
    at Tangosol.Util.ConverterCollections.ConvertArray(Object[] ao, IConverter conv)
    at Tangosol.Util.ConverterCollections.ConverterCollection.CopyTo(Array array, Int32 index)
    at Tangosol.Util.ConverterCollections.ConverterQueryCache.GetValues(IFilter filter)
    at Tangosol.Util.ConverterCollections.ConverterNamedCache.GetValues(IFilter filter)
    at Tangosol.Net.Impl.RemoteNamedCache.GetValues(IFilter filter)
    at Tangosol.Net.Impl.SafeNamedCache.GetValues(IFilter filter)
    at WPFGrid.MainWindow.Cohe() in C:\Projects\BlotterTestGrid1\WpfGrid\MainWindow.xaml.cs:line 49
    at WPFGrid.MainWindow..ctor() in C:\Projects\BlotterTestGrid1\WpfGrid\MainWindow.xaml.cs:line 40
    WinForms c# code
    using System;
    using System.Collections.Generic;
    using System.Collections;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using RflxBlotter;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraVerticalGrid;
    using Tangosol.Net;
    using Tangosol.Net.Cache;
    using Tangosol.Net.Cache.Support;
    using Tangosol.Util;
    using Tangosol.Util.Extractor;
    using Tangosol.Util.Filter;
    namespace WimFormsGrid
            private INamedCache cache;
            private long tradeCount;
      public partial class Form1 : Form
        public Form1()
            InitializeComponent();
        private void Form1_Load(object sender, EventArgs e)
            cache = CacheFactory.GetCache("trade-cache");
            tradeCount = cache.Count;
            ICollection cacheEntries = cache.GetValues(null);
    }

    hi shivshankar,
    there is option on accounting tab page controlling cocpit you click on them. 
    then thruogh ITS it go to your r/3 system there you make nessary settings
    thnax
    sunil jawalkar

  • Re: Error retrieving cache in c# WPF project (No problems in c# WinForms)

    Originally resurrected a long-dead post from 2011 and attempted to hijack it away from the original poster,
    Error retrieving cache in c# WPF project (No problems in c# WinForms)
    but got my inquiry split away to let it stand on its own merits...
    My question is:
    Wondering if anyone could answer... The setup is the same (XP SP3, Coherence 3.7.1.0). GetValues(null) returns different number of values every time.
    More information: the serialized type has just one string property X; push 40000 such items into cache, then making GetKeys(null) followed by GetValues(null) call with 1 sec interval (cache is pre-populated with 40000 items, no insertions/deletions happening):
    Keys 40000, Values 20377.
    Cache is just one storage enabled proxy with schema taken from Coherence example configuration.
    I understand, calling GetValues with null argument is not the smartest thing to do, but the problem is that it affects the number of items returned by the GetValues with a filter passed...

    Hi Thiago V Palmeir,
    Thank you for your response.
    Your problem seems to be about the list of projects in JDeveloper when there are many projects..
    My problem is very different because I have only 3 projects in the application and the problem occurs when deploying to manually added Integrated Web Logic Installation with the domain that I created (not the DefaultDomain created by JDeveloper)..
    In any case, I tried to delete system11.1.1.5.37.60.13, start JDeveloper, and it re-creates the folder. I then re-create the additional IntegratedWebLogic server instance in the application server navigator and try to run my application using that instance of integrated web logic.
    The error still happens.
    Regards,
    Arief

Maybe you are looking for

  • How to control the cursor position on a text item..

    Hello, How can we control the cursor position programmatically on a text item. i.e. how do we move the cursor to home or end of the text item. TIA, Hiten

  • GS60 digital audio - how is this used?

    I have a GS60 and I would like to use the digital audio output to connect to a receiver.  This laptop has 2 audio jacks: - Microphone engraving, 3.5mm jack with mini toslink capability - Headphone engraving, 3.5mm jack, electrical only I found some b

  • Upload a sound file as the custom greetings voicemail message

    I tried to find a recent thread but couldn't find anything on this. I have an up-to-date iPhone 5 that I need for business. I'd like to purchase a professionally recorded voicemail message, but I want to confirm that I'll be able to upload it to the

  • Windows service pack 2 and Oracle10g Enterprise manager access problem

    I have problem accessing the OEM-page from a computer other than the one Oracle10g is installed on. I suspect the Windows XP SP2 is blocking me from making the connection from and external computer. Hence I need to unblock the .exe file. But what is

  • Java 45 electronic signature problems

    Hi there Im trying to apply for a job online and it is asking for an electronic signature. When i go through the steps to get one it checks my computer, browser and java. It failed on the java check because I had the latest version of java and it sug