7ds ошибка 65540 1

I’m doing an ios application, it starts a server and listen for incoming connections, the device running the application may be behind a router so I need to make a port forward.
I’m trying to make a port forward using DNSServiceNATPortMappingCreate but its always returning error code -65540

DNSServiceRef *sdRef = NULL ;
void ( *DNSServiceNATPortMappingReply) (DNSServiceRef sdRef,
                                        DNSServiceFlags flags,
                                        uint32_t interfaceIndex,
                                        DNSServiceErrorType errorCode,
                                        uint32_t externalAddress,
                                        DNSServiceProtocol protocol,
                                        uint16_t internalPort,
                                        uint16_t externalPort,
                                        uint32_t ttl,
                                        void *context );

DNSServiceNATPortMappingReply = &DNSServiceNATPortMappingCreate_callback ;

DNSServiceErrorType error = DNSServiceNATPortMappingCreate(sdRef,
                                                           0,
                                                           0,
                                                           kDNSServiceProtocol_TCP,
                                                           htons(2000),
                                                           htons(5000),
                                                           0,
                                                          DNSServiceNATPortMappingReply,
                                                           NULL
) ;

and this is the callback

void DNSServiceNATPortMappingCreate_callback(
                                         DNSServiceRef sdRef,
                                         DNSServiceFlags flags,
                                         uint32_t interfaceIndex,
                                         DNSServiceErrorType errorCode,
                                         uint32_t externalAddress, 
                                         DNSServiceProtocol protocol,
                                         uint16_t internalPort, 
                                         uint16_t externalPort, 
                                         uint32_t ttl, 
                                         void *context )
{
    printf("in callback\n") ;
}

I am migrating a database application from Windows 2008 R2/SQL Server 2008 R2 to Windows 2012 R2/SQL Server 2016 that uses a third party .NET CLR assembly to parse strings.

The error I get is:

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 ‘clrsplit, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’ 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) [SQLSTATE 42000] (Error 10314).

Error: 10314, Severity: 16, State: 11.

The database TRUSTWORTHY bit is set:

name             is_trustworthy_on
msdb             1
SimplusStaging   1

PERMISSION_SET is set to UNSAFE. Assembly is marked UNSAFE because those were the vendor installation instructions. Have tried dropping the Assembly and related T-SQL objects and re-creating them. No change. The DBO user is the SA login. And, this is the only CLR assembly we use for this database/server.

This is a new install using detach/attach. Did the KB2919355 install because otherwise SQL Server 2016 wouldn’t install.

I would love to use the new STRING_SPLIT function in 2016 except that the application is supported by a third-party and they built everything for 2008 R2. Wanted to take advantage of some of the new features in 2016 where «it just runs faster».

The SID of the db owner is the same for both the original install and the new install. Both of the following queries return 0x01 when run in the context of the problem database:

SELECT [sid] FROM sys.database_principals WHERE [name] = N'dbo';
SELECT [owner_sid] FROM sys.databases WHERE [database_id] = DB_ID();

Do I need to recompile the CLR assembly for a new .Net Framework or should it just work?

Doing this same migration to SQL 2012 and 2014 on Windows 2008 R2 worked without issue.

bildschirmfoto 2013-11-20 um 19 27 37

Browsing for _airplay._tcp
DATE: ---Wed 20 Nov 2013---
19:28:03.956  ...STARTING...

; To direct clients to browse a different domain, substitute that domain in place of '@'
lb._dns-sd._udp                                 PTR     @

; In the list of services below, the SRV records will typically reference dot-local Multicast DNS names.
; When transferring this zone file data to your unicast DNS server, you'll need to replace those dot-local
; names with the correct fully-qualified (unicast) domain name of the target host offering the service.

_airplay._tcp                                   PTR     Lt\.\032Doolittle._airplay._tcp
Lt\.\032Doolittle._airplay._tcp                 SRV     0 0 7000 Lt-Doolittle.local. ; Replace with unicast FQDN of target host
Lt\.\032Doolittle._airplay._tcp                 TXT     "deviceid=7C:D1:C3:0C:0C:8A" "features=0x5A7FFFF7,0xE" "flags=0x44" "model=AppleTV3,1" "pk=0a44638953b197db1988e1b2e934226853a39e9b090af3ae4a6d44b271a777c4" "srcvers=190.9" "vv=2"

Я делаю приложение ios, он запускает сервер и прослушивает входящие соединения, устройство, использующее приложение, может быть за маршрутизатором, поэтому мне нужно сделать порт вперед. Я пытаюсь сделать порт вперед, используя DNSServiceNATPortMappingCreate, но его всегда возвращает код ошибки -65540DNSServiceNATPortMappingCreate всегда возвращает код ошибки -65540

DNSServiceRef *sdRef = NULL ; 
void (*DNSServiceNATPortMappingReply) (DNSServiceRef sdRef, 
             DNSServiceFlags flags, 
             uint32_t interfaceIndex, 
             DNSServiceErrorType errorCode, 
             uint32_t externalAddress, 
             DNSServiceProtocol protocol, 
             uint16_t internalPort, 
             uint16_t externalPort, 
             uint32_t ttl, 
             void *context); 

DNSServiceNATPortMappingReply = &DNSServiceNATPortMappingCreate_callback ; 

DNSServiceErrorType error = DNSServiceNATPortMappingCreate(sdRef, 
                  0, 
                  0, 
                  kDNSServiceProtocol_TCP, 
                  htons(2000), 
                  htons(5000), 
                  0, 
                  DNSServiceNATPortMappingReply, 
                  NULL 
) ; 

и это обратный вызов

void DNSServiceNATPortMappingCreate_callback(
             DNSServiceRef sdRef, 
             DNSServiceFlags flags, 
             uint32_t interfaceIndex, 
             DNSServiceErrorType errorCode, 
             uint32_t externalAddress, 
             DNSServiceProtocol protocol, 
             uint16_t internalPort, 
             uint16_t externalPort, 
             uint32_t ttl, 
             void *context) 
{ 
    printf("in callback\n") ; 
} 

Понравилась статья? Поделить с друзьями:
  • 7d ошибка бмв e53 активация вентилятора
  • 79h ошибка часов штрих
  • 7990 ошибка kyocera p2040
  • 7990 ошибка kyocera 2735
  • 797 ошибка при подключении к интернету pppoe