Problem with Protobuf - c#

I switched to work on another computer, I installed visual C# express and protoBuf-net,
and then I copied the source of the project to the other computer.
Now when I open the project on the second computer, the program does not serialize and deserialize the data.
When I'm debugging, every time I step into a piece of code using Protobuf, I get this message:

I'll check the project files for a problem (that _fixed looks highly suspicious) but unless you need the "v2" features it may be easier to use the pre-built dll that can be downloaded. Since this appears to relate to pre-release software it may be easier to e-mail me (as the author) directly.
For info, there are some bat files in the repo that should cleanly build the core project for common .net versions. I can't check right now (away from PC).

Related

Putting all required files within one executable

Title
I am pretty new to C# (although I'm coming from java so I'm catching up quickly) and when using Visual Studio and building, I get a bunch of files as well as the executable, including dlls with the names of a few of the nuget packages I installed, a dll, pdb, etc. I also realized that I can't just give out the .exe from that folder because it references the files surrounding it. I want to put all of these files into one final executable that uses the needed files without installing them. Also, my project uses Tor and the only thing I need help with there is being able to package my project with tor as well (again, preferably in the same executable so that the user doesn't have to have tor installed to use my program.
TL;DR/summary: how do I include all the required dlls in 1 final .exe that will also be able to hold another exe (tor) inside it so that tor doesn't have to be installed for it to work?
I guess I could download the tor expert bundle when the application is launched but again it would be nice if this wasnt needed
I found an answer that I guess will work for now: How to merge multiple .NET Core assemblies into a single one (.dll / .exe)?
This still doesnt fix the problem of trying to keep tor inside the executable, but I guess I am just going to have tor download into some temp folder until I find a better fix.
use .net core 5.0 . Use with Ilmerge nuget manager.

C# Application Executable will not run on any other device

I have devoloped a C# Application to search a certain directory, read in any files containing a certain string, and then compare those to a database and do various things with said information. I need to upload the project\exectuable to another machine where it will contantly run on a timer, however Every time I try to open the exectuable on any other device I get the windows error, the GradeUpdate (my project name) has stopped working. I created the project in Visual Studio 2013, and only have a few references out of the ordinary which are as follow, and I made sure these references are in my release folder that I copy over to the device which I need the program to run on.
MySqlData.dll
MySqlWeb.dll
I recreated the project from scratch thinking it may be a naming issue, but this did not make a difference. In addition a C# application written in Studio 2010 works on the machine that I am trying to access, however the 2013 application I wrote does not. I believe there may be some local file not included in the project folder that it access's on my local computer, but that is my best guess, any and all suggestions would be very welcome!
Could it be that the machine doesn't have the version of the .NET runtime you're targeting? If you're using Visual Studio 2013, your app may be targeting .NET 4.5. Can you make sure the target machine has the .NET 4.5 runtime installed?
the infamous works on the machine this is a common mistake that beginners make when learning to code.. just because it works on your machine will not guarantee that it will work on others I would first look at the properties of the .dll / assemblies and make sure that you have the CopyLocal property for the dll's set to true make sure that not only are you adding the assemblies in the using header section, but manually adding them to the reference node.. also make sure that the target machine has the same .net framework installed on their machine.

Is there a way to avoid installing VS extensions like "SQLite for WinRT" for each teammember?

We are developing a Windows Store C#/XAML application that has to (among other things) interact with SQLite database and display Bing maps for specific GPS coordinates.
"Official" way to do this seems to be to install two Visual Studio extensions - SQLite for Windows Runtime and Bing Maps SDK. I have two problems with this approach:
It is necessary to install them separately on machine of each and every team member. With new PCs, VS reinstallations and people coming and leaving the project, this can get tedious really quickly.
Updates. Let's say I install a specific version of an extension and commit the project referencing that specific version. Then, a new team member comes in and I need to install the extension to his PC as well. However, in the meantime, Microsoft has released a newer version of the extension and I am unable to download the older one - and now, because of one new person, everyone has to update their extensions, too.
Ideally, what I'd like to do is to somehow put these extensions to SVN. That way, they are stored in one place only and there is no hassle with constant installations and updates. I was able to extract .dll files from SQLite extension, but with the Bing Maps, there is a .winmd file as well as a native .dll. I am unable to reference .winmd directly, and loading it dynamically is, as I've come to understand, not possible.
Is there some way to achieve what I want and avoid all outlined problems? I hope I am overlooking something, because I can't believe Microsoft would decide on something so stupid...
Yes, there is a way.
You will find the explanation and an example in this blog post by Oren Novotny: http://novotny.org/blog/how-to-use-extension-sdks-per-project
Kudos to the writer of this post, it saved me tons of work.
I had the same problem when trying to do CI with TFSBuild service in Visual Studio Online in a project that had Bing Maps. We can't install anything in the integration server because is cloud based, so I had to do a very long search to find the solution. It involves modifying the .sln file and putting the files in source control maintaining a precise folder structure, but when you do all this correctly it works like a charm.

How do I deploy System.Management.Automation?

I am helping out with a project that a contractor worked on previously (so I don't have a lot of history for it).
The project builds fine, but when we try to perform some operations, we get a runtime error indicating that System.Management.Automation.dll could not be found.
As a troublshooting measure, we manually installed the dll into the installation directory. We then get an error indicating failure to load Microsoft.Management.Infrastructure.
As nearly as I can tell, these dlls are present in the Microsoft Management Framework download, and possibly in Powershell 3.0.
My question: What is the smallest package that these dlls are a part of, and what is the best way to deploy them for a production software release?
Edit
Just to be clear -- I am not looking to hack/frankenbuild by deploying just those dlls "naked", I am trying to identify the correct redistributable package for those dlls. I just can't seem to work out which one it is.
Edit
If it helps, the nature of the code that we are running is to programmatically create an exchange mailbox.
I think you can't legally redistribute any of those two DLLs alone (discussed for example here for the Automation, you can also check the "Redistributable" section on MSDN for those namespaces). You will have to make sure the target machines have PowerShell and the Management Framework.
Just in case anyone else runs into this problem: We ended up resolving the issue by deploying the Windows Management Framework 3.0, which includes the necessary assemblies. http://www.microsoft.com/en-us/download/details.aspx?id=34595

Using Sharpen and eclipse : error "Application "sharpen.core.application" could not be found in the registry."

Background
I'm currently doing a benchmark of solutions to convert java code to c#
We have a fast evolving java software and wan't to port some low level (not ui) apis with a tool, because maintaining all changes between versions could prove really tiresome...
Anyway, I've been trying to use Sharpen, as I heard it's a pretty wicked tool used by some mono "freaks" to keep some versions of their tools in check.
What I did
For this purpose, I tried several tutorials I found on internet, the easiest to understand being http://www.pauldb.me/post/14916717048/a-guide-to-sharpen-a-great-tool-for-converting-java
As the link he gives for a pre-build sharpen plugin is now broken, I build my own version of the plugin using sources and instructions found here : https://github.com/xamarin/XobotOS/
Result
The plugin build perfectly, and is installed in my eclipse folder. But when I try to run the ant script after setting everything up, I get an error :
java.lang.RuntimeException: Application "sharpen.core.application" could not be found in the registry.
Conclusion
Well. I'm lost here.
I have no idea what that means.
I'm using Windows 7 64bit
I'm using Eclipse 3.7
I'm using java 6 sdk 64 bit
If anyone ran into this and has a solution... That be helpful.
Thanks in advance.
Initially I tried the same approach as you did, with the same result. But if you follow the instructions in the README.build file, section Setting things up, you should be able to launch a secondary Eclipse applications with the sharpen.core and sharpen.xobotos plug-ins included.
You could then import your Java project subject to conversion into the secondary Eclipse app, provided that you have included a Sharpen Xobot builder command and nature into your project file, like this .project file in the XobotOS/android folder. I edited the .project file manually before importing the project, but I assume you can also configure this from within Eclipse?
The configuration files provided by Paul Du Bois are not applicable, instead you will need to copy and edit the converter-config.xml file from the XobotOS/android folder. This file in turn references a file in the app sub-folder, which probably also needs to be copied and edited.
This is basically as far as I have been able to take it until now. I have been able to edit the configuration files to enable the converter to run, but at this point I have only been able to generate C# stubs. If you or someone else manages to take this even further, I would be happy to learn how to generate real C# files using the XobotOS Sharpen converter.
UPDATE
Asked Miguel de Icaza if there were any instructions for converting arbitrary Java projects using the XobotOS Sharpen version. He responded that there are many hard-coded details in this version that makes it difficult to apply to arbitrary projects. At this stage he recommends Lluis Sanchez' Sharpen version to be used instead.
BTW, the NGit library has been moved to here. You will find a fully functional sharpen plug-in for Eclipse in the gen/plugins sub-folder.
UPDATE MAY 17
Note that you need to have the Plug-in Development Environment software installed in Eclipse to be able to build and run the plug-in projects. IF you are running Eclipse IDE for Java (SE) Developers, you need to extend it with the PDE software.

Categories