Mono for Android can not create assembly directory - c#

I'm trying to create programs for Android in C#. When I start an emulator and I click the debug button, the output says:
Deployment failed. The assembly directory could not be created.
Have I to have a permission in AndroidManifest.xml, that allows me to create directories and files?
Thanks for answers :).

I have a same problem too.
Try This:
In Project Properties > Build > Change the platform target into x86.
Then Rebuild again.
hope this help.

in project option -> build -> mono for android build
check mark on 'use shared mono runtime'

Are you trying to create a directory in your code, or is this referring to the compiler's assembly directory? You only need a permission in the manifest if you are creating directories and files on the android device (i.e. in your code). You should not need this permission for a simple deployment.
Sometimes it's the simple things: make sure you have enough disk space, and that the full file path is not too long.
If none of that works, it may be an emulator problem; try it on a physical device to make sure.

Related

Could load a file or assembly "Renci.SshNet.dll"

Issue :
System.IO.FileNotFoundException: Could not load file or assembly
'Renci.SshNet, Version=2014.4.6.0, Culture=neutral,
PublicKeyToken=1cee9f8bde3db106' or one of its dependencies. The
system cannot find the file specified.
The Project is built on .Net Framework 4 which helps to transfer the files from local onto S FTP Server.
The Code works fine on my local machine without any issue,When deployed on the PROD server and run as per scheduled giving the error as mentioned above.
Let me know what exactly causing this issue.
If not installing from the gallery make sure the DLL is not marked as blocked. Windows will mark the zip and every file in it for security reasons and you will have to unblock them
Are you developing windows or web application? If web application, try enabling an option in IIS application pool -> Advanced Settings, "Enable 32 bit application" to true. This might solve your problem.
In case of windows or console application, select the reference Renci.SshNet dll and go to its properties and set "Specific version" to false.
After recently upgrading my .NET connector it gave the same error. I compile and run my app in VS and it works fine guessing because it copies all the MySQL NET assemblies to the exe folder so what I did is copied Renci.SshNet.dll to the directory of my exe and it worked. For some reason adding the path to the path system variable didn't help. Final solution was to remove the NET Connector and use mysqld in batch to do the selects and updates for the app.
Looks like you're missing the Renci.SshNet.dll.
In your project references you can edit the properties of Renci.SshNet. Make sure "Copy Local" ist set to true. It will copy the dll on build to your output directory (should be bin/Release).

Creating a "portable" .exe (without installer)

I've recently coded a little program to determine numbers in a picture and it is reliant on two libraries I've used. (DLLs)
Since my target computer is not allowed to install programs due to security reasons, I need to create a portable .exe.
.NET is installed on the target computer but for some reason VS still does not include the libraries I've used in the exe but instead creates an application folder with a setup.exe, some .DEPLOY files and an application manifest.
I am new to VS and .NET in general so this question could be easy to answer, but I'm asking since I've found nothing useful on StackOverflow neither on google.
You can simply build the application and copy your bin/Debug folder along, but that would still mean you need multiple files.
In order to merge all references into the executable, use ILMerge. Here is some help calling ILMerge.
Basically, after building, you should do something like this:
ilmerge /target:winexe /out:SelfContainedProgram.exe
Program.exe ClassLibrary1.dll ClassLibrary2.dll
There is just one file you need to send along.
One way to do this is to build your application in Release mode (You can pick from Debug or Release in the drop-down). Then go to C:\Projects\[ProjectName]\[ProjectName]\bin\Release (The location of your project folder may vary). You'll see a bunch of files but all you really need are the DLLs, executable, and the config if you used one. You won't have to do any setup if you keep the necessary files in the application's folder, just copy them all to a folder on the target computer, create a shortcut if you want then you're good to go.
You can just copy all your assemblies into any folder you want. Simply chose "Build" from within Visual Studio and copy the files from bin/debug to your destination-folder.
However you have to ensure that all (relative) paths (if existing) still work as you cannot be sure where the user of your program copies the files to.
One simple way could be to use 7zip Packager, it doesn't need any installer. However, VisualStudio method might be more reliable.
I encountered the same issue recently. ILMerge suggestion above is no longer supported. I found Fody.Costura as a modern replacement.

ClickOnce with external EXE will not validate

Here's a famous error I'm getting on VS 2010, using ClickOnce deployment. It works fine locally as well as with a setup deployment. The publishing is working fine.
Here's the error I receive when I try to install the application from the ClickOnce:
'Reference in the manifest does not match the identity of the downloaded assembly CrmSvcUtil.exe.'
I've tried the most popular solution (as well as all the other solution I found on internet) http://geekswithblogs.net/rakker/archive/2007/12/06/117449.aspx
I really don't know what to do. The CrmSvcUtil.exe is in my required files (added by itself... but if I remove it, the ClickOnce stops working at all)
Do you have any other idea of how to fix that? Or a workaround?
Thank you very much!
Is CrmSvcUtil.exe your main executable, or is it an additional executable in your application? It sounds like a change is being made to that file after the manifest has been created such that the file hash no longer matches (this can happen, for instance, if you sign your assembly after the manifest has been created).
Do you have that exe added to your project? What is the build action (should be 'content') and what is 'copy to output directory' ? (should be 'copy always').
Is that executable signed?
Are you publishing with Visual Studio?
Are you re-signing with Mage or MageUI after it is initially published?

Access SDExplorer (System Folder) from my C# app

I am trying out Windows Live SkyDrive, and I installed SDExplorer (http://www.cloudstorageexplorer.com/)
It works by adding my SkyDrive folder to Windows Explorer, but it does not get a drive name or anything, so how can I access that drive/folder from my C# application?
When I go into the folder and look at the address bar it says "Computer\SDExplorer".
Directory.GetDirectories(#"\Computer\SDExplorer") does not work, because it translates to "C:\Computer\SDExplorer".
I would like to be able to create a small application that can create folders and upload files to my SkyDrive account.
Anybody know how these special folder/drives work? - I noticed MozyHome appears in the same way in my Windows Explorer.
Some background info: http://www.technospot.net/blogs/how-to-create-a-system-folder-in-my-computer/
The SDExplorer folder is a system folder. You can find it in the registry at the following location
HKEY_CLASSES_ROOT\CLSID{0016CE0E-728C-4FC9-98E5-D0B35B384597}
Instead of using shell32.dll it uses C:\Program Files\SDExplorer\SDShellNSE.dll,0 with the parameter a0800018 instead of a normal path.
If my assumptions are correct, the folder location is hidden somewhere in that DLL file. I had a look with a hex editor but could not find anything useful.
Thanks a lot for your replies. Because I am interested in how this works I will try to dig a little deeper. Thanks for pointing me in the right direction.
I have managed to build my small application (made it into a service), which can create folders and upload files to SkyDrive. I did this without SDExplorer, and instead I used the SkyDrive .NET API someone build here: http://skydriveapiclient.codeplex.com/
Greetings
Søren

C# console app deployment

I have a simple C# console application developed on my local machine using VS2008 Pro. I want to know how to deploy this solution onto a network share folder?
A similar Java console program is already placed (as a JAR file) in the same network share folder. Users simply open command prompt, navigate to shared folder and type "java -jar programName.jar inputParameter1 inputParameter2"
How can I achieve the same with .NET?
You can copy the exe over yourself, go to the bin folder in the directory your source code is in and copy it there.
or you can click the BUILD menu and use the PUBLISH menu item. This will allow you to enter the path to your network share and visual studio will copy the built app to the folder for you.
If your application is really "simple", you should be able to just copy the files to a shared folder and run it from there. However, if your "simple" application tries to do things that are restricted by the permissions you might have to configure them with caspol. Assemblies loaded from a shared drive have much fewer permissions than the ones loaded from a local drive.
It would be mostly the same process as the Java program. To deploy, compile the program and copy the exe from the bin folder (along with any dependencies) to the network share.
To run the program users would open the command prompt, navigate to shared folder, and type "programName.exe inputParameter1 inputParameter2"
You can use Publish feature of VS. Note that you can change settings in the Publish section of the console application project to remove some features that you don't need. For instance the renaming of .dll and .exe files by appending the '.deploy' extension to the name of the files or publishing in a new 'version' folder each time. Go to "Project Properties"->"Publish" and remove "Automatically increment revision" checkbox at "Publish Version", click "Options..." button and clear all checkboxes there too.
Right click your project, select publish which will make an executable, you can put that in your shared drive, similarly users can go into the command prompt and run it and give some args.
In the exact same way assuming they have the proper dependencies installed (.net, 3rd party assemblies, etc). copy the bin folder then have them execute the exe file.
Take a look at ClickOnce deployment:
ClickOnce is a Microsoft technology
for deploying Windows Forms or Windows
Presentation Foundation-based
software, also called Smart clients.
It is similar to Java Web Start for
the Java Platform.
MSDN
Wikipedia

Categories