I am here for help in one of my tasks to integrate IBM Rhapsody models into VS 2019 C++ project.Here is what we are trying to do.
Please note: I am not an expert in IBM Rhapsody Systems Engg tool. My expertise is WPF and .net application
We have generated Rhapsody model for an automatic car dashboard using Rhapsody 8.4. It has general functions like to turn on/off the various lamps(parking,ignition status,gear position,etc.) on dashboard which works fine. Now, we have generated the code in rhapsody as .h and .cpp files. We created an empty C++ project in VS 2019, added files for OXF framework, adaptor files and also the above generated files.
The folder structure as below:
enter image description here
When we compiled this project, we had all kinds of errors related to not being able to find the OXF framework which we were able to fix after adding proper #include paths in header files.
We also have written a wrapper file which will allow us to be able to import the generated dll into another WPF project and use it there.However after removing the path errors,project could not be successfully compiled as we are still looking at one error which says
*
'OMReactive':'class' type redefinition.
Before posting here I have spent 3 weeks researching on google, on IBM rhapsody website and also on stackoverflow.com and none of the solutions provided has worked for me.I know that above error means that somewhere some file in included twice.I have tried using #include guards and also #pragma once, but this has not resolved my issue.
Please if anybody has any idea what is going on here? I have tried to explain and give as much as information as possible.Let me know if any more information is needed. Apologies if I have missed out on any information or unclear about anything.I am at a dead end now and need help. Any ideas, any suggestions? what should I try next? I wonder if the steps I followed to add the rhapsody models into VS 2019 is incorrect or Rhapsody framework not properly included or missing some file somewhere.Please let me know proper steps. IBM Rhapody website does not have exact information on what I am trying to do.
All I want do to is generate a DLL out of the model classes to use in WPF project.
Thanks for reading my question and sorry for being so long.
Thanks..
Asma
Rhapsody can generate code and a makefile. You can then build that from inside Rhapsody (it calls the makefile) You have to select the compiler in your configuration (under Component) You can use VS17 there, it will work for VS19 as well.
If you create a VisualStudio Configuration (right click on your Component and then select Add VS Configuration) Rhapsody will link to a VS project and deploy your files directly.
If that does not work: try using a Willert Framework ( have to be bought)
Yet another option would be to generate code in Java. Rhapsody brings its own JRE. Since you do Systems Engineering you do probably not need to use C or C++.
Walter
Related
We have a Roslyn-based static analysis tool. To build a C# project, either through an .sln or .csproj file, we use the MSBuildWorkspace. In this scenario, everything works well.
Recently, I bumped into an old-style Web Site Project (WSP), one that does not contain a .csproj - pages are compiled on-demand by the server (unless if precompiled). Not surprisingly, the MSBuildWorkspace doesn't support such "project-less" projects, as confirmed by item 2 in this reply.
The difficulty now is to feed the build with the necessary dependencies/assemblies. To deal with such use case, our static analysis tool offers a flag like -I path/to/dll so that users can specify directories where to find those DLLs - and I create MetadataRereferences for them. While this approach works, it doesn't come with the best user-experience, because the user is not always a developer and might not know all the locations/details.
I'd like to ask whether anyone is aware of an alternative approach to build a project-less Web Site Projects where we could "instruct"/setup Roslyn to mimic the process done by an actual web server to compile the aspx.cs files?
Thank you!
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;
Firstly, thank you for bothering to look at my question as 5 days of Googling has left me dreary to say the least.
I would like to know of a way that I can compile and then deploy without the use of Visual Studio. I am able to compile and then use MetaDataProcessor.exe to generate my PE (Portable Executable) files with the -minimize option. However, this seems to be where I get a little stuck. I believe that I am supposed to generate a database file including all of the PE files referenced in my application, and from there I am supposed to convert this into a Motorola SRecord file, however when I take these steps I am getting this result:
1) My .hex file is somewhere around 3.5x larger than the .hex file I pull off of my board after using Visual Studio to deploy (65kb from VS and 305kb with my steps)
2) When attempting to deploy and run my .NETMF application, I receive an error from the board itself saying that at least one of my assemblies has a null checksum (it aborts after the first null checksum received)
What is the secret step that I am missing, or what step am I using incorrectly here? Any help here would be greatly appreciated.
Thank you,
James.
Several years before I started working at this job another developer who is no longer here wrote an application in classic ASP using HTML, vbscript and javascript. This is fine but the problem is that 2 pages were written in C# with an HTML file and a code behind file. There was no solution files for these two pages. They may have been originally created in Visual Studio but they don't exist in it now.
That is important because there is a lot of things that Visual Studio just does for you without even thinking.
My problem is that in these two C# pages I need to get them to reference a DLL. This is a simple task when using Visual Studio. You just add a reference to the project and life is good. But outside of VS nothing seems to work.
I tried putting the dll in the same folder as the pages and then I tried the following:
Using myDLL;
myDLL dll = new myDLL();
myDLL dll = myDLL();
I found some code online that said to create an internal static class and use [DLLImport()] but that didn't work either. It couldn't find the dll or the Entry Point for the dll. I am currently researching how to create an entry point, just in case this is the method to make everything work.
Outside of having to rewrite these pages in vbscript (which I don't have the time to do) I am at a loss.
Has anyone ran into this problem before? Is there something that I can put in the web.Config? Or is this just impossible and I am hosed.
BTW this is all running under the 2.0 .net framework.
If you drop the DLL you want the code to reference into the bin folder of the website, then open the web.config and locate the following section configuration -> system.web -> compilation -> assemblies.
You need to add the display name of the assembly to that list - so that the compiler will reference that assembly during it's late-bound build process.
Now you should be able to use the stuff that's in it on those pages.
If you don't the know the display name of the assembly (typically yourassembly, version=*.*.*.*, Culture=neutral, PublicKeyToken=null for culture-invariant, non-strong-named assemblies) you can open it in a tool like ILSpy (there are others, it's just become my favourite) and it tells you when you select it in it's UI:
sorry for the poor highlighting - jerky hand following far too much coffee
If all the code in that assembly is in a single namespace, also, you can also add a default using to all the .cs or .aspx code in the project by adding that namespace to configuration -> system.web -> pages -> namespaces - making it simpler to use that code in the pages.
I created a VS Solution/Project for my app. I compiled and published it to the web server. When I published it I had it copy all project files.
I ran it and it crashed because it could not find my dll.
I tried adding the lines that Andras mentioned above and it seemed like it was getting me closer but it only changed the errors I was getting.
Then I went into IIS on the web server. I expanded the folder listing under Web Site. I right clicked on the folder that contained my app and made that folder into an application folder.
After I did that everything just worked. So then I thought I would see what happened if I backed out all of the additional code I added to my C# app and the Web.Config file. It still worked. All I needed to do was to make the folder an application folder in IIS and put a Using statement in my C# app and life is wonderful again.
Thanks for all the comments and suggestion. Andras thanks for the link to ILSpy. That is a cool little tool.
Take care,
Robert
I agree with Jon, it sounds like you should try creating a new project for these files. It's always better to leave code better off than you found it. If a new project is not an option for some reason, you should indicate this in your question.
I have some breaking changes to WCF contracts and I want to be able to support two versions of the contracts from within the same website.
somewhere.com.catalog.v1
class A
class B...
somewhere.com.catalog.v2
class A
class B
I would like to have a utility program to copy the files from v1, into v2 and change all the namespace references so I don't have to do a manual copy and find & replace.
T4 template - need to parameterize this. I found a custom templating project on codeplex.
PowerShell script. Found Aaron Lerch's blog which seems to be close to what I wanted, but I have the worst problems with PowerShell and got a compile error. I tried downloading some PowerShell extensions for Visual Studio 2010 to get auto-complete but ran into extension conflicts.
Razor template. From what I read it seems to be targeted to single file generation.
MSBuild task using the TextTransform utility.
Just create a command line C# program that takes in the input folder, output folder and new namespace.
Other _______
Just having trouble choosing the best tool for the job and wanting to learn something new that can be applied in other situations.