We wrote a MS Word Add-In using VSTO 2.0. In this Add-in we've connected to a sql server database. Anything went fine. Now, our client wants to switch to an Oracle DB. When we try to connect now via the Sytem.Data.OracleClient Provider, we get a SecurityException saying:
"Request for the permission of type 'System.Data.OracleClient.OraclePermission, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."
during the call of connection.open
Our Assembly has full trust. The DataAccess Layer Assembly is loaded via Unity. All Assemblies are strong named
Any Ideas?
Google gave me just some ASP.NET related stuff.
Problem was, that the main Add-In had full trust, but the dal assembly didn't
Related
Using the latest SDK for Dynamics CRM, I am attempting to create a new CRMServiceClient([ConnectionString]). I try to do anything with it including a WHOAMI request, and I get Unable to Login to Dynamics OrganizationServiceProxy is null. When I run fiddler, nothing is even attempting to communicate to the server to attempt a login. I am unsure what is wrong, as I would have thought newing up a CRMServiceClient would have tried to connect since OrganizationServiceProxy is a child object of CRMServiceClient. Anyone have any ideas how to approach solving this?
var temp = new CrmServiceClient(ConfigurationManager.ConnectionStrings["conn"].ConnectionString);
<add name="conn" connectionString="AuthType=AD; Url=Url/DEVCRM; Username=User; Password=pass;"/>
Please note that CrmServiceClient has a boolean property called IsReady, which is a good way to check if it's in a proper state.
And for reference, here are example connection strings for the various environment types:
CRM 2016 and Dynamics 365 online:
<add name="dev26" connectionString="Url=https://dev26.crm.dynamics.com; Username=user#dev26.onmicrosoft.com; Password=Pass; AuthType=Office365" />
On-premise with integrated security:
<add name="prod" connectionString="Url=http://myserver/AdventureWorksCycle;"/>
On-premise with credentials:
<add name="prod" connectionString="Url=http://myserver/AdventureWorksCycle; Domain=mydomain; Username=administrator; Password=password; AuthType=AD;"/>
On-premise IFD before CRM 2016:
<add name="prod" connectionString="Url=https://contoso.litware.com; Username=someone#litware.com; Password=password; AuthType=IFD;"/>
On-premise IFD for CRM 2016 and later (v8.0+)
<add name="prod" connectionString="ServiceUri=https://contoso.litware.com/contoso; Domain=contoso; Username=contoso\administrator; Password=password; AuthType=IFD; LoginPrompt=Never;" />
Based on your connectionstring I would suggest you to add domain to it. That should resolve your issue. Check following example:
Named account using on-premises authentication
<add name="MyCRMServer"connectionString="AuthType=AD;Url=http://contoso:8080/Test;Domain=CONTOSO; Username=jsmith; Password=passcode" />
You can find more information in following article - https://msdn.microsoft.com/en-us/library/mt608573.aspx
I have found that .net 4.6.2 doesn't play nicely with the CRM SDK, if you are running that version of .net upgrade or downgrade the framework installed on your computer.
Updating to .net 4.6.2 from .net 4.5.2 causing Object Reference Exception on ExecuteCore method within xrm sdk
If that isn't the cause, enable tracing to get more detailed error messages, see following article for details: https://msdn.microsoft.com/en-au/library/dn689064.aspx
I need to create a service reference to the Magento 2 SOAP API in my Visual Studio project. So I've created an Integration in the Magento backend, gave it All access and activated it.
But when I try to access the WSDL for (ie. the customer API) at http://my.magento/soap/default?wsdl&services=customerCustomerRepositoryV1, I get the exception:
Consumer is not authorized to access %resources
Ok, I get it. I need my access token to access these specific 'admin' API's. Because public API's like 'quoteGuestCartRepositoryV1' do work. When I get the full API list at http://my.magento/soap/default?wsdl_list=1 it also only lists public/guest API's.
No problem so far, but when I try to add the 'customerCustomerRepositoryV1' as a service reference in Visual Studio, of course the authorized exception is thrown. But I have no way of actually adding the access token to the header there.
Is there a way to get access to all WSDL's anonymously? Magento 1.x used to allow this.
Yes, it is a Magento error. The WSDL is not available anonymous anymore since a recent Magento release. I think it's a stupid decision by the devs.
https://github.com/magento/magento2/issues/5330#issuecomment-255222166
And for the 'solution': https://community.magento.com/t5/Programming-Questions/Magento-2-C-APIs-SOAP-problem/m-p/49677#M1206
I registered a plugin assembly using the SDK Plugin registration tool. I am trying to add a step but cant see any of my custom entities in the Primary Entity field. Am I missing something here? It is a trial instance of CRM Online and I am logging into the default organization.
Entities are only loaded once, and then cached by the Plugin registration tool. Make sure you publish your changes in CRM, then completely shut down and restart the Plugin Registration tool.
Regards,
I Created an ASP.NET MVC 5 Website using the template of Visual Studio 2013 with Individual User Accounts to use Identity 2.0.
Also, I follow the instructions (http://www.asp.net/identity/overview/extensibility/overview-of-custom-storage-providers-for-aspnet-identity) for changing the Entity Framework layer to use Dapper.
Everything worked fine, the only issue is the multiple open connection to the Microsoft SQL Server.
When I log-in to the website, open a connection, and when I navigate to the Home and go to view the account info, or go to change a password, each navigation to a Controller open a new connection to the database. I verify the open connection in sys.sysprocesses table. Does The template have a logic error? The original template with Entity Framework handle connection well? I have to rework the original logic in the template with Identity 2.0?
So I deployed my website this morning to my test server using "Build Deployment Package" in Visual Studio.
In IIS we import the website and deployed it as a new site, everything is fine there.
But when we launch the browser, we hit an error:
HTTP Error 401.0 - Unauthorized
You do not have permission to view this directory or page.
Most likely causes:
The authenticated user does not have access to a resource needed to process the request.
We tried to give all access to users for folders and also alternate from anonymous login to form Authentication without success.
Help would be appreciated! Maybe I missed a permission somewhere..
I found my problem:
For some reason, visual studio was not compiling my resources and Dlls in the package.
I had to set all resources in project at Embedded in properties and I manually copy my dlls on the server