Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change my configuration from "Debug"?

My site works fine, but when I [re]publish it via Build > Publish Web Site, it says that it's in Debug configuration. I would think it should be something else, like "Release," but that option is not available to me in the dropdown below the Tools menu - "Debug" is the only available option. Note: I do have debug set to false in web.config.

If I click on the configuration dropdown, it does have a "Configuration Manager" menu item, but that simply brings up the eponymous dialog, and the project "record" in the grid on that dialog has the same thing - a Configuration dropdown with "Debug" as its only option.

Platform is set to "Any CPU" (this is an ASP.NET site/app), the Build checkbox is checked, the Deploy is not (and won't let me check it, presumably because Configuration == Debug).

So how can I change my project/site to Release mode?

UPDATE

Okay, this seems rather bizarre. Based on Arma's comment/suggestion, I searched for the *.sln file; I found .sln in C:\Users\Clay\Visual Studio 2012\Projects\, but C:\ is where the project is actually saved.

Yet the *.sln file there does have today's date for last modification. Why is the .sln in one place, the project in another, yet files in both places are being updated?

UPDATE 2

At Arma's request/behest, here is a scream shot of the Solution Explorer (most of it, anyway):

enter image description here

UPDATE 3

It seems as if Visual Studio has scattered my project files in two different places - it's preferred/default location (C:\Users\Clay\Visual Studio 2012\Projects\) as well as in the spot where I specified the project to be created (a folder below the root that I created). If this is why I'm having this odd problem (Debug is my only configuration option), I need to know how to rectify it, and how to avoid it in the future. ASAP (tomorrow) I will bountify this question. If somebody answers it prior to them, I will generate an after-the-fact bounty and award it to them.

like image 878
B. Clay Shannon-B. Crow Raven Avatar asked Sep 02 '13 20:09

B. Clay Shannon-B. Crow Raven


People also ask

How do I stop debug mode?

Accepted Answer To exit debug mode, press Alt+B followed by D. at the Command Prompt to exit debug mode.

How do I change debug config in Visual Studio?

In Solution Explorer, right-click the project and choose Properties. In the side pane, choose Build (or Compile in Visual Basic). In the Configuration list at the top, choose Debug or Release. Select the Advanced button (or the Advanced Compile Options button in Visual Basic).

How do you disable the debug option Enable just my code?

To enable or disable Just My Code in Visual Studio, under Tools > Options (or Debug > Options) > Debugging > General, select or deselect Enable Just My Code.


4 Answers

The Build configuration in the Publish Profile doesn't matter for web site projects, it only matters for Web Application projects. See http://msdn.microsoft.com/en-us/library/dd465337.aspx

"This setting doesn’t have any effect for web site projects. For a web site project you’ll see Debug listed as a build configuration, but that has no effect when the web site project is compiled dynamically. For more information, see Web Application Projects versus Web Site Projects in Visual Studio."

like image 86
tdykstra Avatar answered Nov 15 '22 08:11

tdykstra


It shouldn't matter that your solution and project files are in different locations. To fix that just move your solution file and edit its XML by updating paths to project files.

I think the answer you're looking for is a means to publish a Release configuration where the web.config is deployed with debug="false". Is that correct?

Have you tried adding a new Release configuration in Configuration Manager? This should generate a Web.Release.config transform file beneath your Web.config file (if not then right-click Web.config and choose Add Config Transforms). Then look at using transformation syntax (http://msdn.microsoft.com/en-us/library/dd465326.aspx) to define exactly what you want your deployed Release version of Web.config to contain. Your Web.Release.config will look something like this:

<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
    <system.web>
        <compilation debug="false" xdt:Transform="Replace" />
    </system.web>
</configuration>

P.S. I like the concept of a "scream shot" :)

like image 43
Tom Troughton Avatar answered Nov 15 '22 08:11

Tom Troughton


You can enable this from options to show the Solution in Visual Studio Solution Explorer

Tools -> Options -> Projects & Solutions ->General-> check the checkbox "Always show solution" 

Then right click the solutionFile in SolutionExplorer -> Choose OpenFolder in windows Explorer to Open the exact solution file. Make sure to keep a backup file of your solution file before making any change. Now Edit the solution file, look for below sections, and add as the after section.

Before:

GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|Any CPU = Debug|Any CPU
                EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {97A7F977-AF9D-494E-AB65-32CCB9A06F30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {97A7F977-AF9D-494E-AB65-32CCB9A06F30}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {8C498C19-A5BB-41A2-BA03-B2DC384EB605}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {8C498C19-A5BB-41A2-BA03-B2DC384EB605}.Debug|Any CPU.Build.0 = Debug|Any CPU

    EndGlobalSection

After:

GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|Any CPU = Debug|Any CPU
        Release|Any CPU = Release|Any CPU
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {97A7F977-AF9D-494E-AB65-32CCB9A06F30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {97A7F977-AF9D-494E-AB65-32CCB9A06F30}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {97A7F977-AF9D-494E-AB65-32CCB9A06F30}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {97A7F977-AF9D-494E-AB65-32CCB9A06F30}.Release|Any CPU.Build.0 = Release|Any CPU
        {8C498C19-A5BB-41A2-BA03-B2DC384EB605}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {8C498C19-A5BB-41A2-BA03-B2DC384EB605}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {8C498C19-A5BB-41A2-BA03-B2DC384EB605}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {8C498C19-A5BB-41A2-BA03-B2DC384EB605}.Release|Any CPU.Build.0 = Release|Any CPU
    EndGlobalSection

Here "97A7F977-AF9D-494E-AB65-32CCB9A06F30" and "8C498C19-A5BB-41A2-BA03-B2DC384EB605" is the ProjectIds, this could be different in your case.In this case i have only 2 Projects in my solution. you have to do this for every projects in this solution. Hope this helps.

like image 38
sudhAnsu63 Avatar answered Nov 15 '22 08:11

sudhAnsu63


I'm not sure but in your project folder open Web.config and change debug="true" to debug="false" and then save and upload it. Does it work?! If it doesn't work write your error here to more suggestions. (I'm so sorry for my bad English speaking) . . . . I forgot it! Open your projects .sln file and the double click on the "My Project" on the Solution Explorer and the select compile on the left and the on the top select your configuration mode

like image 20
Arma Avatar answered Nov 15 '22 07:11

Arma