.NET Micro framework Compile and Deploy without VisualStudio - c#

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.

Related

Integrating IBM Rhapsody models into VS 2019

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

VS Code noob here, question about launch.json

So far i only wrote c# code in visual studio and for unity. However i decide to work on my C# fundamentals a bit instead of coding only for Unity, hoping to improve my understanding about OOP and designing my objects.
I started to follow pluralsight c# path where dotnet core used with visual studio code instead of regular visual studio. Next 18 hours i actively tried to run Hello World application. After i tried everything google has to offer yet failing, tens of times uninstalling and installing stuff yet failing.I somehow managed to do trick by creating an empty folder at "C:\Program Files (x86)\Microsoft SDKs\NuGetPackagesFallback" by following the tail of error messages.
You may comment something like, "you have learned a valuable lesson" etc. which may be true but i don't want to. I don't want to be an expert at making compilers run, i don't want to learn how they function. I just want to make my code better.
Now i could run Hello World app by using dotnet run from command line where i felt nice, finally i can move on to improve my OOP stuff. But wait VS Code didnt want to proceed.
After couple hours of tweaking i could finally run the code but i am not happy with it. The reasons why, and what i am asking is below.
VS Code build .json files with this lines..
tasks.json had "/property:GenerateFullPaths=true",
which i had to replace with "${workspaceFolder}/src/GradeBook",
and launch.json had
"program": "${workspaceFolder}/bin/Debug/<target-framework>/<project-name.dll>",
i had to replace it with
"program": "${workspaceFolder}/src/GradeBook/bin/Debug/netcoreapp3.1/GradeBook.exe",
What i don't mind is adding "/src/GradeBook" only if i have to do that when i use subfolders for project. I don't know if the problem with tasks.json was related to this. But do i have to fully replace tags like <target-framework> when .csproj file has a definition of target framework <TargetFramework>netcoreapp3.1</TargetFramework> .
I really do not understand how these .json files work, why auto-generated files do not do their job and how i can live interacting minimally with those. What are the minimal steps i "have" to take care of myself. Can somebody please explain me and please treat me like i am 3 years old with 5 IQ because i fell like one when i am dealing with these stuff.
After struggling a bit more i somehow found this.
https://www.reddit.com/r/vscode/comments/6ozrwj/is_there_really_no_other_way_of_adding_required/
There was a reply
Adding assets can be done with dotnet.generateAssets command. You can
invoke the command using the command palette (Ctrl-Shift-p), search
for .NET: Generate Assets for Build and Debug.
Which was looking exactly like the thing but unfortunately i got error message :
"OmniSharp server is not running" / "server has been stopped or not
started"
I somehow reached https://github.com/OmniSharp/omnisharp-vscode/issues/32 where was this comment
BedmanGit commented on 10 Jan 2019 Add path to environment works
http://reddyinfosoft.blogspot.com/2017/07/cannot-start-omnisharp-error-error.html
I added Windows/System32 to PATH. VS Code asked me if i want to generate necessary assets. I clicked yes. My project worked without me having to manually editing .json files.

Error using haarcascade_profileface.xml

I am writing a program in C# using Visual Studio Express 2013 for Windows Desktop. I want to detect faces that are in profile, so just one eye is visible. I am using haarcascade_profileface.xml for the detection. Every time I try to debug my code I receive this error message:
Error of type "Emgu.CV.Util.CvException" has occurred in Emgu.CV.dll. Additional Information: OpenCV: The node does not represent a user
object (unknown type?)
I use the same code that I use with haarcascade_frontalface_default.xml and with this xml it works.
I really need help. Please help me.
Thanks, B
emgu, using opencv's deprecated c-api, can only read cascade files in the old format (build with opencv_haartraining). you cannot use that cascade file with emgu. blame their devs for living under a rock.
Use the haarcascade files from here instead: https://github.com/Itseez/opencv/tree/master/data/haarcascades_cuda
As berak said, yours are in the wrong format
Emgu using libs from OpenCV, so you need add this libs into your project. The visual studio can´t add as reference the native OpneCV libs, so you can include the libs on root project and set to build always copy to folder 'bin'.
Set project to buld for 64bit processor

C# - Microsoft Expression Encoder missing reference, how to add them to project?

I have an application that has an Image Capture feature.
When I try to build it in Visual Studio 2012, I get missing references to Expression Encoder. The image capture facility has been achieved using Microsoft Expression Encoder, and it uses code from it's API. In order to build this application successfully, the PC where I'm trying to build needs some sort of Expression Encoder codec where it will get the references from.
I have tried installing the full application (Microsoft Expression Encoder 4) which is about 25MB, which fixes all the references. We do not want that, due to the application being offered to clients, which means they will have to install another application, the Expression Encoder 4 on top of our application. I'm thinking that there must be a codec of some sort that contains these missing references which is of course smaller than 25MB.
The missing references are the following:
Microsoft.Expression.Encoder.Devices;
Microsoft.Expression.Encoder.Live;
LiveJob
LiveDeviceSource
EncoderDevices
EncoderDeviceType
EncoderDevice
Source Properties
Preview Window
Does anyone have more experience with this and knows how to fix the missing references?
Thank you very much.
Here's an article that shows workarounds for missing Microsoft.Expression.Encoder.resources.dll file, I was able to get through all exceptions using it, but got stuck on 'Appliation not licensed. To fix, install and run application.'
Link to article:
http://uprightbassics.blogspot.com/2014/01/how-to-deploy-expression-encoder-4-sdk.html
This is not possible to deploy an application that uses EE4 SDK without installing the entire application on the target machine. Things had to change from EE3 to EE4 but it does not. Even if you try to "copy local" DLLs in your application location, it requires to install the 25MB EE4 application.
Hope this helps.
Add reference to
microsoft.expression.encoder.dll
Check in C:\Program Files (x86)\Microsoft SDKs\Expression\Encorder 4
If possible copy the dll into your project and change the property Copy To Output to Copy Always.

Visual Studio "Rebuild all failed"

Why does Rebuild fail with no errors?
Since this morning, this error keeps showing up. I build the entire solution (25 C# managed projects) and a "Rebuild All failed" appears, but without any errors! (I have 13 warnings about COM not supporting Generics, but it's "normal" because one dll is exposed as COM.)
Not an answer per se - but you're better off looking at the output window and seeing what it says there.
Also, to help with that you might want to look at your MSBuild verbosity - as shown on this screenshot (last two options):
Beware - the highest level generates a MASSIVE amount of information.
Finally - running msbuild from the solution folder in a command prompt will really nail the issue - because error messages and warnings come up in red and yellow respectively.
I found my own solution and it is simple:
When this error occurs, save the project and close VS 2013. After that, re-open VS2013 and open the last project.
It works like a charm. But it is very annoying every time!
Many people reported this problem in VS2010, VS2012 and VS2013.
Could be a corrupt Solution User Options file.
Close the solution, delete its .suo (.v12.suo for VS2012+), reopen the solution, and Visual Studio will build a new one. You will lose the StartUp Project, breakpoints, bookmarks, which files are open, which projects/folders are expanded, etc. But that's all minor compared to the solution not building!
I had the same problem. I was trying to refrence a higher .net framework version(4.5.2) to lower .net framework version(4.5) which was causing build error. I made the version same in both projects and it worked.
Check the Output Window (View -> Output) as that will tell you what's going wrong. Sometimes a reference might be missing or there is an issue with the targeted version of .NET for one project in a solution.
Have you tried to clean the solution befor rebiuld it?
This is the list of checks & things I would do if I were you (try to build after each step):
Is error list activated? (Sometimes I forgot to activate and I can see only warnings & messages)
Check output window for error messages..
Clean solution.
Double check after clean that everything is deleted from debug folders.
Build it in release mode.
Build solution project to project until you isolate problematic project.
Remove COM and comment code to see if is this the source of problem.
Restart VS2010.
Restart windows.
Few moments ago I fix it with repair of .NET Framework installation (.NET Framework v4.0 Extended in my case).
I had the same issue in VS 2015. I tried the following with no success:
Close VS project and reopen
Close all open VS projects and reopen just the project that had the issue
Clean solution
Rebuild solution
Delete all files in bin\debug and bin\release
Lastly I tried Keith Robertson's answer, delete .suo (\Visual Studio 2015\Projects\[ProjectName]\.vs\[ProjectName]\v14\.suo). Although this didn't get me a good build, it did finally give me an error message stating that I had two entry points to my application. I went to application properties (Alt + Enter) and select a Startup object from the drop down.
This error seems a bit generic to me. I also went through this situation, but I managed to solve it differently than any of the ones mentioned here.
I have a project and several dependencies. And one of these dependencies has undergone a change.
When compiling the main project in debug mode, I verified that everything was ok.
However, switching to release mode and recompiling the problem occurred.Rebuild all failed and 0 Errors
By analyzing the debug output, I encountered an error:
Although the build dependencies are configured correctly. When compiling in release mode, the main project did not find the new method created in the secondary project.
So I had to recompile each secondary project one by one in release mode. After that, I recompiled the main project and everything worked.
Hope it helps someone!
I just had the same thing. For me, it helped to restart VS and run it as Administrator.
Select the appropriate target framework
- Right click on project
- Properties
- In application tab, Select the target framework
clean the solution
Try and build each project and see where the issue is.
Check each of the references (of each project) to make sure not have the yellow warning sign
Has the solution ever built?
I just had this happen to me, and realized that I left a '#error' line in my code and forgot about it. When I tried to build, the build failed but the #error line didn't show up in my errors.
Try searching all for '#error'
I fixed it on my new implementation of Visual Studio 2013 by going to the database project / Project Settings and noticing that the Target Platform was SQL Server 2014 instead of 2012 like it should be.
Once chance of getting this error is when we try re naming the service reference name, we give some other name in the service reference, but in the namespace some where it will be referring the old name, so if you delete and add a service reference then keep the same name, else we may face this error, but we can see the error in the Output window.
There are apparently many causes of this. I just found the cause of my issue: the .NET version of a new project I created was higher than the version of the top-level project. (4.5.2 vs 4.0)
I got a similar issue today, and fixed it with repair.
Start
Run…
Appwiz.cpl
(Find your installed Visual Studio version)
Right click
Change
Repair
In my case it was the wrong date and time of computer.
I was getting no feedback/messages/errors. Just that all projects failed to build.
I closed and tried again--I noticed an error saying "you are not authorized to access..."
I clicked on my account, re-entered my credentials, and rebuilt the solution.
Voila! I got what I am used to seeing when I build a solution -- plenty of errors in all their glory.
Hope this helps someone.
Here's yet another reason which may sound familiar to some. I had integrated some code into my solution that wrapped a DLL. The C# code file that came with it offered a nice managed API and handled the low-level LoadLibrary stuff to access the DLL. Both had the same base name, so I had SomeName.cs and SomeName.dll. I could just drop it into any project and it would work.
This wasn't so nice after a while as I started using it in different projects. I got copies of both the DLL and the wrapper code in multiple projects. So I figured it would be better to drop the wrapper code and the DLL into a new class library project and then reference that new project from other projects.
After I had done that, I started to get this issue. The build went well up until the very last stage and then failed without error. Output showed nothing but successes.
The problem was the name of the wrapping class library project. I used the same base name (SomeName) for this. By default the assembly name would be SomeName.dll and I already had one such file (the DLL to be wrapped), thus I had a conflict with output files.
After renaming the wrapping project and its output assembly to SomeNameWrapper, the problem went away.
This may not be your exact cause but it seems likely you have some name clash or deployment issue as well. And it is not surprising the compiler won't give you an error because there is no problem in the compilation phase, the trouble starts with deployment and apparently this does not come out in an obvious way.
I had the same problem the original poster was displaying with 0 errors and Rebuild all succeeded. The Output tab showed a message that a referenced dll was built with a higher version of the .NET Framework.
Changing the .NET framework to match resolved the issue I was having with 0 Errors and Rebuild All succeeded.
The solution:
Because Prerequisites not set for debug set only for release
01-Change solution configuration ( in main screen )
set (debug to release)
set solution platform to (Any CPU)
02-Set Prerequisites for debug ( If you want to continue in debug mode )
03-set target platform version for all Projects
Some of the files included in your solution are not in the correct directories, or you have changed the name of one or more directories in your application. In the solution explorer under Setup review the list of all files and remove those that are not properly listed in the SourcePath Property.
One of my dependency in View file caused this. Check your view files for any dependencies which is not injected yet.

Categories

Resources