Deploy to Memory Card When Debugging - c#

I'm trying to run and debug a C# winforms app on a mobile device running Windows CE 5. It's only got a tiny "hard drive" memory but I've stuck a memory card in it with plenty of space. Unfortunately when I hit debug in Visual Studio it deploys the app to "program files" on the main hard drive memory and it doesn't fit.
Is there a way to make Visual Studio deploy the app to the memory card when debugging rather than using the main drive? I can't find any option like this. I'm using VS 2008.
Thanks a lot
Mark

See the answer to this question.

Related

Running .Net application on visual studio code in MacBook pro

I am doing C# programming in Visual Studio Code in MacBook Pro, so whenever I run the application, a dotnet process is left in the memory, when I open the Activity Monitor the memory is not disposed, and the CPU is running at 100% even after the debugging is stopped. Is something wrong with my code or is there anything else that I should be doing while writing c# code in Mac OS. Please let me know, right now after every run I am opening activity monitor and force quitting the process.
You just need to have .Net Core and C# extension installed.
The High CPU consumption is often caused by an issue in an extension.
You can open the Process Explorer using Help>Open Process Explorer to view the list of running VS Code processes running in real-time where you'll find what is causing High CPU consumption where extensions are executed by the Extension Host process.
If the High CPU consumption isn't caused by VS Code then it's probably your code and you'll have to optimize it.
You can check the Performance Issues Wiki for more details here

deploy simple c# app to another computer from Visual Studio 2017

I have written a simple c# app to let my son do some stats on dice rolling for a game he is developing.
I created a simple interface using Visual Studio 2017 and Universal Windows.
After loads of silly errors - and lots of less silly ones, I finally have an app that runs as I want it to in debug mode.
I now want to publish it so he can copy the files and run it on his Windows computer.
Now I am sure this is really easy - but after 2 days of google searching, MSDN searching and searching this forum I am no nearer knowing what I need to do.
I have changed the solution configuration to Release and the platform to x86. I have run Build and Deploy solution form the build menu and have loads of files in my bin/x86/release file partial list from windows explorer.
But none of the exe files seem to do anything (the app5.exe waits a while sometimes, but no sign of the app anywhere).
I am obviously missing some critical preparatory step, but I can't find out what it is.
Some of the MSDN notes talk about Publish (this is greyed out or not present, but Deploy appears).
Can anyone please point me to some idiot proof documentation to help me work out what I should be doing.
I am new to Visual Studio, new to C# and new to windows app development - so my app has been pulled together from web research and using common sense :)
I have assumed that what I am trying to do is pretty easy - but I am not yet convinced.
To sell your Universal Windows Platform (UWP) app or distribute it to other users, you need to package it. If you don't want to distribute your app through Microsoft Store, you can sideload the app package directly to a device. Since you used the VS, you can follow this document to package a UWP app with Visual Studio: https://learn.microsoft.com/en-us/windows/uwp/packaging/packaging-uwp-apps#sideload-your-app-package.
After you package your app, if you want to sideload your app, you can follow the How do I sideload an app on desktop part in the following document:
https://learn.microsoft.com/en-us/windows/application-management/sideload-apps-in-windows-10#how-do-i-sideload-an-app-on-desktop
More details, you can get from this topic:
https://learn.microsoft.com/en-us/windows/uwp/packaging/

The process cannot access the file 'CustomTabsClient_CustomTabsCallbackImpl.class'

I've upgraded my Windows to 10.0.16299 (latest) and my Visual Studio to 15.5.1 (latest). Since then, I am seeing this error message when I clean or build my Xamarin solution containing an Android project:
obj\Debug\android\src\android\support\customtabs\CustomTabsClient_CustomTabsCallbackImpl.java:4:
error: error while writing CustomTabsClient_CustomTabsCallbackImpl:
obj\Debug\android\bin\classes\android\support\customtabs\CustomTabsClient_CustomTabsCallbackImpl.class
(The process cannot access the file because it is being used by
another process)
I figured that the locking process is Visual Studio itself after I tried to run and debug the app.
The issue appears no matter whether I want to run the app on an emulator or a connected real device.
There's lots of advice what to do when a process locks a file including SO such as the famous the process cannot access the file because it is being used by another process. However, all provided answers don't help as Visual Studio itself locks the file and the only workable workaround is to restart Visual Studio - that's not a solution.
What is causing this file to be locked? Any idea? Any advice?
Sometimes it helps to kill the MsBuild.exe. Also, you could find other solutions such as described here: Xamarin Android project cannot build....
Basically, it seems to be a problem with Studio 2017 Version 15.5. It will be fixed with the next versions probably.
Darn it, my suggestions won't fit in the context of a comment, so here goes:
Sounds like the process being debugged, or the emulator hosting the debugged process, itself, has not fully closed down, and is in a hung or semi-hung state. Have you checked the process manager to see if this is the case? You may want to to try adding Environment.Exit() to see if this helps come back to a good state.
Another thing to check is, whether your access levels are the same between the two machines. Check not only the PC, but also at the emulator as well. Check everything, and ensure the access levels/modes are identical.
Finally, try running VS 2017 in administrator mode, and see if the problem persists. It's entirely possible that the level of access that you used to run pre-Windows 10 is different in the Win10 world that you live in, now.

C# WinForms App won't run on Win7 after Building

I have a program that I built that reads and writes files. I built it in Release mode, then tried to run the exe on Win7. At first, with troubleshooting on, Windows simply told me the application closed and it was looking for a solution. After a few seconds, the dialog would disappear and show nothing more.
So with some significant effort I got the debugger attached to the process, but it was only showing me disassembly, which tells me that the error taking place wasn't in my application code, but in the framework somewhere.
The strange thing is that when I let the debugger attach, then press "stop" in VS, and exit the debugger, the program actually runs at that point!
So now I'm stumped. I have an application that builds, that seems to be having a permission error when I run it, but if I let the debugger attach then close it, it runs, and there's no Exception to really look at.
How I troubleshoot this issue?
Edit: Responding to Merlyn:
It's a custom app written from scratch in c#. The only dependency it has outside of core .NET namespaces is the Ionic.Zip DLL.
Visual Studio 2008 (Writing in C# 3.5)
Windows 7 - Home Premium, v6.1 build 7600
CPU - x64 quad core
CPU are you compiling under: Any CPU
I haven't tried it on another machine or a different version of VS.
Edit: I was able to try the compiled version on another win7 computer, and it worked without issue, so it looks like a security (?) issue on my computer only.
Try it in the debugger with Just My Code disabled and Native Code enabled, then check the call stack.
Also, what happens if you run it directly in Visual Studio?
Uncheck Enable Visual Studio Hosting Process in Project Properties and see whether it still works in VS.
I'd suggest sending the issue to Microsoft support. Especially with the data given here, you will have an easy time convincing them it's their problem. You might need an MSDN subscription for that.

Debug not working for Win CE 5.0 Device

I'm working with a handheld device running Windows CE 5.0. The program runs, however I'm not able to debug and hopefully its something simple and stupid burried in project settings somewhere.
So, as to not mess up the main app, I decide I'll start a brand new SmartDevice application. So MS builds its default settings, environment, path for the new project and defaults it's first form "Form1". I shrink the form up some and put a single button on it with code in its CLICK event for "This.Close();"
Compile and try to debug and it comes up with the empty circle with warning triangle icon...
"The breakpoint will not currently be hit. The specified module hasnot been loaded."
What's up...
To answer Bryan's question... I'm connected via USB via ActiveSynch 4.5 the other programmer in our office uses the same configuration for debugging but he's out of town this week and I've been tasked with some review of processes.
Also, I'm using Visual Studio 2005, not 2010...
It is possible your device may be "locked down" by the device manufacturer or the mobile operator making it difficult to debug a running application on the device.
MSDN has a great resource center on debugging Windows Mobile applications at:
http://msdn2.microsoft.com/en-us/library/bb158521.aspx
In the middle of the page you will find a note about default security settings and a link to an article titled "Deployment, Setup, Security and You".
You may want to sign your application before having Visual Studio deploy to it to your device. You can find more information about that at:
http://msdn2.microsoft.com/en-us/library/ms839681.aspx
Problem was the version of Compact-Framework SDK. I had to uninstall, re-install and put CF SDK SP1 in... Debug now working...

Categories