CRM 2015 Online OData Service - c#

Everyone,
I am working on displaying read-only crm data in sharepoint. I followed the directions at Develop1.net. So that means that I used the WebAppWalkthrough from in the CRM 2015 SDK. This worked great and the data does appear in my SharePoint App. But, when I generate a new xrm.cs file, to get access to my customization's, I get the following in my broswer:
I did use the included CrmSvcUtil.exein the SDK. The code that I ran to generate the xrm.cs file is:
CrmSvcUtil.exe
/codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration"
/out:"..\Xrm.cs"
/url:https://<Org>.api.crm.dynamics.com/XRMServices/2011/Organization.svc
/username:<user name>
/password:<password>
/namespace:Xrm
/serviceContextName:XrmServiceContext
/servicecontextprefix:Xrm
This will successfully create a new xrm.cs file but as soon as I update my solution and rebuild it I get the Request Error in the browser. I have tried the above code with the /generateActions flag and even registered my computer using the Device Registration Tool to get a deviceid and devicepassword. I then added the\deviceid and \devicepassword flags to the above code. Again the file is generated with no errors, but as soon as I add it to the solution I get the error mesassge.
So I though maybe it was something wrong with the WebAppWalkthrough. I redownloaded the SDK again and had the same issues. So I decided to build the OData service from scratch following the directions at Microsoft. Same error again.
My code is no different then what can be found in the SDK or at the Microsoft link. I get no build errors and no errors in Visual Studio.

There appears to be an issue with the way code is generated via the CrmSvcUtil.exe. Here is what I ended up doing that got things to work:
1) I modified the WebAppWalkthrough file. Basically I just deleted the .aspx pages since I don’t need them.
2) I deleted the Xrm.cs file that is in the folder.
3) I created a blank C# class file called Xrm.cs.
4) I used a tool called XrmToolBox with a plugin called Early Bound Generator
a. I was able to create a separate .cs file for each entity including the XrmServiceContext.
5) I manually copied the code from the opportunity file and the XrmServiceContext file into the blank Xrm.cs file.
6) Anything that had an error in the new Xrm.cs file was deleted
7) Added [assembly: Microsoft.Xrm.Sdk.Client.ProxyTypesAssemblyAttribute()] above the namespace.
8) Added using Microsoft.Xrm.Portal.Web.Data.Services; inside the namespace.

Related

NuGet AppForSharePointWebToolkit package does not add TokenHelper.cs to project

I am developing an application to consume a SharePoint 2013 API. The SharePoint is on premises, not online. The AppForSharePointWebToolkit package is supposed to install, among other things, a TokenHelper.cs file to my project allowing me to access the TokenHelper class functions, as shown below.
string siteUrl = “site.url.net/foo”;
string realm = TokenHelper.GetRealmFromTargetUrl(new Uri(siteUrl));
However, the TokenHelper.cs file does not get installed for me, and thus I am met with the following error (code CS0103): “The name ‘TokenHelper’ does not exist in the current context.”
I assumed the TokenHelper.cs file is available somewhere on the internet for me to copy manually, but I am unable to find the source code, and every StackOverflow answer I’ve come across simply says to install the AppForSharePointWebToolkit which will automatically add the file, though as I’ve said, that has not worked for me.
Any help would be appreciated.

Did not find new element in the hierarchy for item

I am trying to create a simple page for a Xamarin app but am completely unable to proceed with the most basic of steps. I check out the branch from the project repo, and attempt to add a new file. When I do so (Right clicking on folder, Add-> New Item->Content Page) I get this error:
It does actually create the .xaml file but not the .xaml.cs file to go with it. I first tried to manually create the cs file and associate it but ran into increasingly mysterious errors. Today I created them outside of VS before booting it up and both files are now present but with the dotted icon instead of a regular one and the cs file is not nested beneath the xaml file.
If I try to open my projitems file inside VS to make the association I am given the error "Specified method is not supported". If I choose to 'Open With', no screen ever pops up allowing me to choose. After this I closed down VS and edited the projitems file in notepad again and linked the xaml and cs file. This looked as though it worked but when I add it to the main TabbedPage with a simple Children.Add(new MyReviews()); it is not recognized -> The type or namespace name 'MyReviews' could not be found.
These error happen if I make my own branch based on the master or try to add a new file to the master directly. No one else in the project is having these errors.
The only thing I really did differently from the rest is try to get the emulator working for android which apparently has a lot of compatibility issues and requires older versions of the xamarin plugins. I was not able to do this and ended up uninstalling and reinstalling everything twice since I didn't touch the installer software the first time and everything stuck.
Is anyone able to help me debug these issues or know why I am encountering so many at every turn?
I've been in the exact same situation. As it turned out, the rest of my team had added Universal Windows Platform (UWP) support to their VS2017 install, and I hadn't. Running the Visual Studio Installer and adding UWP fixed this issue completely.
Of course, you might not need or want to include UWP support in any of your Xamarin apps (I didn't). It seems most likely that it's just one or two support assemblies that are mssing or wrong without the UWP support, but I haven't found the time or energy to figure out any more details.

Automatically Install Module/Extension in DNN (DotNetNuke)

Does anyone know if there is a way of automatically installing an extension on DNN using .net ?
It used to be possible using the infamous Install.aspx page, which has been removed for security reasons.
I've tried refactoring the code within Install.aspx so as to automate this, or even run it for a single module, but no luck. I've just got to the point where the zip has gets unpackaged, but what I really want is to know which and how the tables in the Sql Server database get modified.
I would appreciate any pointers on this.
It is quite hard to find all the tables that get updated, as well as the data that gets put into them.
My solution was is to simply call a copy of the installation page, which can be done from, say, a desktop app. For some reason the original Install.aspx won't run if you add it to the DNN installation. Step by step:
Find the Install.aspx and Install.aspx.cs files. They are deleted after the first installation, but you can get them from the original download.
Make a copy of these two files and rename them, e.g. MyInstall.aspx and MyInstall.aspx.cs
In Visual Studio run the DNN installation as a web site, not as a web project.
Now the page MyInstall will work just as the Install did. You can pass the parameters in the url.
Before you call the page, you need to put your module packages into the corresponding folder e.g. for modules install/module of the DNN Installation. To create the module package use Christoc's VS templates.

Unable to Implement CalendarContract w/ Xamarin.Android

I have been wrestling with the Android Calendar for a couple of days now and I'm at my wit's end.
Following the instructions found here:
http://docs.xamarin.com/guides/android/user_interface/calendar/
I have begun a new ICS project and added permissions to read and write to the calendar. According to the instructions linked above I should now be able to "interact with calendar data by using the CalendarContract class." However, when I input the first line of example code:
var calendarsUri =CalendarContract.Calendars.ContentUri;
I get an error saying that "The name 'CalendarContract' does not exist in the current context."
I have download sample code for the CalendarDemo located here:
http://docs.xamarin.com/samples/CalendarDemo/
I can open the project, manipulate the code, deploy it to my test device with the modifications that I have made and it works perfectly. The problem is that I cannot seem to get CalendarContract to "exist in my context" if I create a project from scratch. Even adding in the CalendarListActivity.cs into a new project won't work. This leads me to believe that there is something I have to set in Xamarin Studio, not via code and not indicated in their tutorial, that I have yet to find.
What setting or reference do I need to add into a new or existing project in order to use this feature? I've looked everywhere I can think of and cannot find the elusive switch, checkbox, reference or whatever is required. I've burned three days trying to figure this out and I have lost my patience.
I was able to reproduce the error you're having. I created an ICS project in Xamarin Studio and got the same message. I then loaded the solution in Visual Studio and noticed that the CalendarDemo project has a reference to Mono.Android v4.0, but the one created in Xamarin Studio only referenced Mono.Android v2.2 even though I specified Ice Cream Sandwich. That is why you're not able to build.
Changing the Target version in Project Options didn't seem to do anything. A workaround is to add
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
to the .csproj file. See the CalendarDemo project as an example.
BTW: This is on Xamarin Studio v4.2.2 (build 2). I don't normally use Xamarin Studio, so I have never had to deal with this. I'm not sure if it's a bug in XS, but it certainly isn't expected behavior.
Just as a test, I created another project in Xamarin Studio, but this time I just selected the standard Android Application project. Surprisingly, it referenced Mono.Android 4.3.0. So apparently there's a bug in the Android Ice Cream Sandwich project template.
I recommend using the standard Android Application project going forward.
If you are using Xamarin Studio, right-click on CalendarContact and select Resolve. It should give you two options, first will add "using Android.Provider;" to your using statements and the second will append the code to "Android.Provider.CalendarContract.Calendars.ContentUri"
...or just add manually the using statement. :)
You should import this library
> using Android.Provider;
> using Java.Util;

Error "object is currently in use elsewhere" TFS GetLatest

We have our code available in TFS. When we take code in one machine (in a different location) it throws an error "object is currently in use elsewhere". Also one of the C# files is not getting downloaded. When we try to build it says "Source file 'filename' could not be opened ('Unspecified error')
This is not reproduced in other locations. Any idea what could be the issue?
Note: It is an asp.net website. We have used enterprise library. Also there is a chart control.
Note: We are using VS 2010.
I have read the following. But thge difference here is that the error is coming as and when we are taking latest from TFS. Is the TFS doing a build while taking latest itself?
InvalidOperationException - object is currently in use elsewhere - red cross
also
Error : Object is currently in use elsewhere.
If project solution name or some files have unique characters in names or some variable names in code other than basic latin letters, then sometimes moving the project would give these errors.
The first error seems like you are using some unmanaged code in your code base, so you would need to get the code in here which might help in why this is caused.
The second case is of the file being deleted from the repository and that .proj file on your machine has not been updated, so it complains of the missing file, you may have to remove it from your project for it to work. one of the file is not getting downloaded coz its not there in the repository at all

Categories

Resources