My Visual Studio ASP.NET Project Keeps Adding A Release Configuration After I Delete It - asp.net

I have a Visual Studio 2015 solution that contains a ASP.NET MVC 5.2.3 project. Within the configuration manager, I have removed the default Debug and Release configurations for both the solution and project and replaced them with 3 configurations of my own, none of which are named Debug nor Release. Every time I reopen the solution, I repeatedly see a Release configuration added to the ASP.NET MVC project, even after attempting to delete it several times and verifying that it doesn't exist in the raw markup of the .sln and .csproj files. The Release configuration also appears to be blank.
Is this a known bug with Visual Studio? Is there a way to fix this?

Related

Xamarin.Forms upgraded to Maui - Visual Studio Cannot debug/run?

Application upgraded using Microsoft's auto upgrade command line tool.
Some code fixes, and the code builds successfully.
Visual Studio however does not show me any way to debug my app.
When trying to click on Debug anyway, a random Android Emulator from my list(which is not showing currently)
Will open, but deployment will fail without specifying the reason.
Has anyone managed to upgrade an existing Xamarin.Forms project to Maui?
I managed to make VS recognize the Android project in my converted solution.
I added the <SingleProject>true</SingleProject> property into my Android project's .csproj file under the first/main property group, closed VS, deleted Bin, Obj, .vs folders.
After starting VS again , I rebuilt and VS allowed me to debug on selected .net targets like a single project Maui solution.
This is very strange that it works, since this solution is made of 3 project like in a Xamarin.Forms solution, so it doesn't make since that adding this property solves the issue, but there you go.
Delete .bin and .obj folders. Delete solution's hidden .vs folder. Build. Does it show debug option now?
Try restarting VS (after the successful build). Now work?
If not, Create a new project using Maui template.
Use solution / manage all nugets to add nugets used by your project.
Copy all your source files into that new project.
Project / "Add existing items": all those source files.

Visual Studio 2015 codelens issues when using Typescript

I'm using Visual Studio 2015 Enterprise RTM.
When creating an ASP.net 4.6 web application using the Web Api template, I noticed as soon as I add a TypeScript file, the codelens indicators stop working.
I tested this on a new installation, with no extra extensions installed, as well and tried other asp.net 4.6 templates.
When running in safe mode the problem doesn't occur.
Steps to reproduce:
Set the framework to 4.6
Create a web application by using the web api template.
Change authentication to no authentication
Open the webapiconfig.cs in App_Start
The codelens indicator on the register method should say: 1 reference
Add a typescript file called app.ts (doesn't really matter) in the scripts folder, tit may remain empty
The codelens indicator in the webapiconfig file should still say 1 reference
Close Visual Studio
Reopen Visual Studio and open the solution
Check the webapiconfig file, the codelens doesn't show references anymore or on any other file
Any idea on how to debug codelens or does anyone have this problem as well?
I work for the visual studio team that is responsible for codelens references indicators. I can confirm that this is indeed a bug in VS2015 where codelens references stop working when you add typescript files to your project or typescript projects to your solution :( Unfortunately, we missed this bug for RTM. We're currently actively investigating this bug. At the moment, I am not aware of any workarounds for this problem. I can post an update when we have more information to share on this bug.
I may have found a workaround that seems to do the trick for me:
So, I have a solution with multiple projects, only one of which has TypeScript files.
I just unloaded the project, cleaned + rebuilt (some restart to Visual Studio at this point may help + close all opened files), then loaded again, cleaned and rebuilt and now CodeLens shows my references (again, close all open files).
Note that until this bug is fixed, you may have to do this each time you open VS.
Hope this helps!
EDIT: If you only have a single project, then exclude the Scripts folder from the solution, clean, rebuilt, close Visual Studio then open it again. Now you should have the references back. Simply include the folder again.
Best of luck!
in my case references start working after uninstalling vssonar extension, vs2015ent

Changes in dll on converting web application from vs 2008 to 2012

I want to use an ASP.NET web application which was built using visual studio 2008 to 2013. will keep the .net framework to 3.5.
My concern is: There will be changes to .csproj and .sln after opening the project in 2013 but what about the dll to be deployed. would i need to update the hosting environment to 4.0 or any dependency upgrade?
The csproj and sln files will indeed be upgraded, but that has no bearing on the output of compilation.
As long as you continue to build for .NET 3.5, there shouldn't be any additional requirements to deploy your application. One thing to keep in mind is that VS2008 web deploy projects and database projects have been deprecated, and no upgrade path for those exists. So be careful if you're using either of those.
The safest approach for you will be to test the upgrade. Install VS2013, which runs side-by-side with VS2008. Open up the old solution, let VS update it, then do a test deployment. If there's a problem, just revert the change to whatever your last source controlled version is.

.NET - How to debug a DLL?

I need to debug a class library project that is provided to the main project (an ASP.NET website) as a DLL. For example, I need to put some breakpoints in order to check what's happening during the execution.
I tried How to: Debug from a DLL Project, unfortunately it didn't work...
How can I do it?
PS: I have the source code!
If you have the source code, and the .pdb files in your BIN directory, then you can debug through that code. However, You will need to enable external code debugging in Visual Studio.
You need to uncheck the "Enable Just My Code" option: menu Tools --> Options --> Debugging --> Enable Just My Code
NOTE: This will only work for .NET assemblies.
Debugging DLLs in Visual Studio (see #2 in the list) may be what you're looking for (full disclosure: Yes, this is my personal web site).
With method #1, you can't watch variables.
With method #2, step #2, if you can't open the project in the same Visual Studio instance, you can run the binary of the project (that is, run it outside of Visual Studio, but make sure you run the debug version.) and attach the Visual Studio debugger to it (menu Debug -> Attach to Process).
Here are the steps for method #2 so no one has to follow the link:
Attaching a using process to the DLL project. This involved hooking the Visual Studio debugger into a running process.
Open the DLL project in Visual Studio.
Run an application that uses the DLL. This
application can't be run from
another instance of Visual Studio since the
process will already have a debugger
attached to it.
From here you can add breakpoints and step through
the DLL code loaded in Visual Studio (although
the breakpoint will appear disabled
the same as in method 1).
When you build the class library project, the .pdb file is created in the Debug or Release folder of that class library. These two file are referred to by the ASP.NET project when you right click and select the option "Add a Reference" and point to the DLL file of the class library project.

Is There a Visual Studio 2005 ASP.NET debug and release build

Is there a "debug" and "release" build in VS 2005? If so, how do I switch between the two?
Saif:
Are you working on an ASP.NET web site project?
If so, Visual Studio delegates the build step to the ASP.NET runtime, and the ASP.NET runtime picks up debug versus release in the web.config .
I have a post on the topic that will help: Debug and Release Builds in ASP.NET 2.0
Note that a couple things have changed since that time. Namely, MSFT released two add-ins for VS 2005 - one to add real web application projects that have debug and release settings (for the code-behind and loose c# files), and they also released web deployment projects, which can use the asp.net command line compiler. Web App projects became a part of VS2005 in SP1, too.
Use the Configuration Manager. Right-click on your solution in the Solution Explorer, select "Configuration Manager...", and change the active solution configuration.
You can change your project's behavior when in debug or release mode. Bring up your project properties pane, select the appropriate configuration from the dropdowns at top, and change the settings as appropriate. Notice that some changes are made by default for you. For instance, release builds by default are set to optimize code, and debug builds are not.
In the ASP.NET web.config file there is a debug="true" attribute. The first time you run the web application Visual Studio will ask you if you want to turn on debugging, selecting yes will cause Visual Studio to edit the config file for you.
Just remember to make sure you change that back to false for your release builds. For more info click here.
The quick way is to right click on the toolbars and turn on the standard toobar. Then you can quickly change between build targets by choosing the one you want from the solutions configuration drop down.
If you want to change what those configurations do, then follow what Michael Petrotta said in his answer.

Resources