I am trying to use DDEX for npgsql. while following steps provided http://fxjr.blogspot.fr/2011/05/npgsql-design-time-support-preview.html I came across a problem. The steps specifies that after setting up the project to startup project. I should go to the debug option and select start action to external program. But the problem is I cannot see the option for that. below is the screen shot of what I get when I select debug in project properties.
Is there any way around to get the project debug in another instance of devenv.exe to complete my DDEX npgsql setup?
Thanks.
This debug option is not available in VS Express.
The way around this is to manually edit the *.csproj.user file in your project folder, and add the following PropertyGroup:
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<StartAction>Program</StartAction>
<StartProgram>C:\Path\To\program.exe</StartProgram>
<StartArguments>/Something</StartArguments>
</PropertyGroup>
You will need to make sure that the Configuration and Platform (Debug|x86 in my example) match yours.
Cheers
Related
My C# WPF App won't load the symbols file using Visual Studio 2017. I've looked online and checked for the common issues, but can't debug my app. This is new behavior. It had been working (at least a few months ago) as part of a multi-project solution. I have no idea what has changed.
I have a breakpoint set after Main() and it shows solid red until I attempt to run in Debug configuration. As a breakpoint didn't stop the execution, I explicitly break.
[STAThread]
static int Main(string[] args)
{
Application.EnableVisualStyles(); // breakpoint on this line
Application.SetCompatibleTextRenderingDefault(false);
Debugger.Break();
Now when running, it pops up with "Symbol file not loaded" and it says "Binary was not built with debug information".
Checking the "Active (Debug)" configuration project properties, in the Build pane, I see
[x] Define DEBUG constant
[x] Define TRACE constant
[ ] Optimize code
and in the Advanced Build Settings dialog
Debugging Information: Full
Running Build->Clean and then Build->Rebuild and I see both the app.exe and app.pdb files newly created in bin/Debug/ directory. When deleting the bin/ and obj/ directories and rebuilding, I still get the same error when attempting to debug the app.
When I look at the Debug output, along with various loaded Windows DLLs, symbols loaded, I see my application with "Modules was built without symbols."
From the Debug->Windows->Modules window I see my app with "Optimized: No" and "Symbol Status: Binary was not built with debug information." In this same window, I right-clicked my application, selected "Load Symbols" and selected the bin/Debug/app.pdb file. It said, "A matching symbol file was not found in this folder".
I'm going mad trying to figure this one out. It seems it should be built with debug information, but it isn't. Can anyone point me in the right direction?
I'm going mad trying to figure this one out. It seems it should be
built with debug information, but it isn't. Can anyone point me in the
right direction?
It is quite strange issue. I think you could try these suggestions
Suggestion
1) please check whether Assembly Name(Right-click on project-->Application) has whitespace, if so, you should delete the whitespace and rebuild again to test it.
2) enable Define DEBUG constant and Define TRACE constant by right-click on project-->Build.
3) enable option Enable Just My Code and Use Managed Compatibility Mode under Tools-->Options-->Debugging-->General
4) check whether your xxx.csproj file has <DebugType>full</DebugType> node. If not ,you could add it in xxx.csproj:
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>Full</DebugType>
</PropertyGroup>
5) Close VS Instance, delete .vs hidden folder under the solution folder, bin and obj folder. Then restart your project to test again.
6) If you install several nuget packages, you could run this command under Tools-->Nuget Package Manager-->Nuget Package Console:
update-package -reinstall
7) disable any third party extensions under Tools-->Extensions and Updates in case some extensions cause this behavior. And do not forget to restart VS.
8) if your VS has any latest update, please update it.
In addition,
If the new created wpf VS2017 project can be debugged successfully and your wpf project is an old project from the old VS version, I suggest you could create a new wpf project in VS2017 and then migrate the old into the new one to test whet.
You can copy the packages.config file from the old project into the new project's root directory and then run update-package -reinstall to reference these packages to your project automatically.
Any feedback will be expected.
How can I always run a custom script in Visual Studio 2015, even if nothing has changed... but using VS without VS++ installed?
I effectively want to do the same as this question however, my installation of Visual Studio 2015 does not have VC++ installed (as everything we do is either C# or VB.Net) so I do not have access to the same project properties pages.
Using the accepted answer as a starting point, and this article for more details I have added the following to my project file, but I simply cannot get it to run the custom script unless a file in the project has changed...
<PropertyGroup>
<ItemDefinitionGroup>
<CustomBuildStep>
<Command>MyScript.vbs</Command>
<Outputs>$(TargetName).missing</Outputs>
<Inputs>$(TargetFileName)</Inputs>
</CustomBuildStep>
</ItemDefinitionGroup>
</PropertyGroup>
<PropertyGroup>
<CustomBuildAfterTargets>ClCompile</CustomBuildAfterTargets>
<CustomBuildBeforeTargets>Link</CustomBuildBeforeTargets>
</PropertyGroup>
I have done a lot of searching for values for <CustomBuildAfterTargets> and <CustomBuildBeforeTargets> but I cannot find anything official or otherwise. It's highly frustrating for the MS article not to provide details on possible values.
I did also try adding the <DisableFastUpToDateCheck> attribute as per one of the answers, but that still rebuilds the project so isn't what I want.
After adding the Xamarin maps nuget package to my app, I was getting the Java.exe has exited with code 2 error. I enabled multi-dex in the android options and I am now getting the following error:
Expecting class path separator ';' before '\Android\android-sdk\build-tools\26.0.0-preview\lib\shrinkedAndroid.jar'
I re-installed the Android SDK and made sure that I had the latest version, however I am still getting the error. I've spent a good while googling this issue and trying different solutions, however I have not found one to work
There are some issues with multi-dex at the current build. Updating to Visual Studio 2017 13.2 may fix the issue you mentioned. If it doesn´t, you can try two things:
To fix the class path separator error, put your Android SDK in a path without spaces. i.e: C:\android-sdk\ and change the path in Tools>Options>Xamarin>Android SDK Location.
If you don´t want to move the SDK you can create a link with a command line:
mklink /D "C:\android-sdk" "C:\Program Files (x86)\Android\android-sdk"
If even with Multi-dex enabled, it doesn´t run:
When you tick "Enable Multi-Dex" option in the Android project properties, you´ll see the change reflected in the csproj as you would expect
<AndroidEnableMultipleDex>true</AndroidEnableMultipleDex>
But if you take a closer look, there is another similar xml node that keeps its value to false:
<AndroidEnableMultiDex>false</AndroidEnableMultiDex>
Notice the difference between "MultiDex" and "MultipleDex"
Changing the second one to true will make the trick.
I have same problem while adding map with nuget package to my app.
just change the latest proguard.jar file from link
and replce from your android sdk-> tools->proguard->lib->progaurd.jar
and
right click on your android project->select option->build->android build-> enable proguard and enable multidex as well go to Advance ->java heap size put 1G.
I had this same issue running Visual Studio 2017 v 15.2.
As has been mentioned before, this results when you've added enough nugets and packages to your solution that you exceed the 65k method limit in a standard dex file, requiring you to enable multi-dex.
Like others have noted, enabling multi-dex doesn't always fix the problem, because it turns on a flag called "AndroidEnableMutipleDex" in the .csproj file. So, as suggested above, I added the node
<AndroidEnableMultiDex>true</AndroidEnableMultiDex>
but, since I wasn't too familiar with the format of the .csproj file, I forgot to add it under both
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
...
<AndroidEnableMultipleDex>true</AndroidEnableMultipleDex>
<AndroidEnableMultiDex>true</AndroidEnableMultiDex>
</PropertyGroup>
and
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
...
<AndroidEnableMultipleDex>true</AndroidEnableMultipleDex>
<AndroidEnableMultiDex>true</AndroidEnableMultiDex>
</PropertyGroup>
Yes, this a a basic mistake, but it can be easy to make if you're not used to manually editing your .csproj file, especially if you're just wading into this for the first time and not even sure where exactly the bug is coming from.
Also, as others have noted, you will need to move the location of your Android sdk to a path with no spaces.
I have a C# WPF solution that contains three projects, MyApp, MyAppAdmin and MyAppLibrary. MyAppLibrary is referenced by the other two.
I need to be able to include MyAppLibrary.pdb when I publish MyApp (click once) but it does not show up in the projects Application Files even with "Show all files" checked.
If I open the Application Files for MyAppAdmin and have Show all files checked MyAppLibrary.pdb is in the list.
Any idea as to why the difference and/or how I can get it into the list for MyApp?
Thanks,
Dave
You didn't say what type of projects you have, so I can't confirm that this will work for you. If you have a web project, then you should be able to uncheck the Exclude generated debug symbols option on the Publish Web property page in Visual Studio.
Failing that, you can try to set that value directly in the project file. Right click your project file in a Windows Explorer window and edit in a text editor. You can add a new PropertyGroup with this value to the end of the file (within the Project element) like this:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
...
<PropertyGroup>
<ExcludeGeneratedDebugSymbol>False</ExcludeGeneratedDebugSymbol>
<PropertyGroup>
</Project>
It looks like this issue is related to what solution platform is used. We need to run the application in 32 bit mode due to some dependancies we have. When this was originally setup we created a custom solution platform for some reason where MyAppLibrary and MyAppAdmin used the Any CPU platform but MyApp used x86. I switced to using the Any CPU for all of them and then specifying in each project to target the x86 platform.
Once this was done I know can see and include MyLibrary.pdb in the published output.
Dave
I've download sample code with C#. but when I run I get this error message:
A project with an Output type of Class Library cannot be started
directly In order to debug this project, add an executable project to
this solution which references the library project. Set the executable
project as the startup project.
Please give me a solution.
The currently selected startup project is a Class Library.
You need an entry point for your application. Does your solution contain multiple projects?
Are you sure you want to 'run' the Class Library?
Possibly you've downloaded a Class Library solution only. In that case there might be unit tests that you can 'debug' to step-trough the code.
Update
In response to your comment, these are possibilities to run the class library:
Create a console application and reference the class library. Then 'use' its contents
Debug an unit-test project
start existing client project
If you have a project with an executable right-click this and select "Set as start project" - if not you have to write one to debug your code (or use Unit-Tests).
The debug settings of your Visual Studio development environment might be left blank. Please check if the following highlighted fields are missing, if they are missing then fill it up with your specific executable.
These fields are required to let the VS start the program for debugging. In the above picture, I'm developing a VSPackage so the:
The external program is devenv.exe
Command line argument is /rootsuffix Exp (for starting the experimental instance).
Note: I can assure you the answers mentioned in here didn't help me fix the issue because my project was already set as a startup project, now I came across an MSDN blog which helped me and lead to this answer.
You need to check that you have the startup project setup correctly.
If there is more than one project in the solution, right click on the one that should be run when you compile and choose Set as startup project
I was trying to run a Debug test with breakpoint in the specFlow feature.cs file instead of the Step.cs file. Put the breakpoint in the Step.cs file and it's working as expected. Thanks!
Try to close Visual Studio and restart it by opening the file you are trying to debug from Unity
None of the answers provided above helped me resolve this error, this is what resolved the issue for me.
Right click on the solution and select "Properties", which is in my case "Sintctech.Data".
Select the section called "Application".
Check what you have selected as your output type. If it is "Windows Application", change it to "Console Appication".
Rebuild the solution
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartAction>Program</StartAction>
<StartProgram>C:\Program Files (x86)\Microsoft Office\Office14\excel.exe</StartProgram>
<StartArguments></StartArguments>
<StartWorkingDirectory></StartWorkingDirectory>
<EnableUnmanagedDebugging>true</EnableUnmanagedDebugging>
</PropertyGroup>
</Project>