What's purpose of <Use64BitIISExpress /> element in csproj file - webforms

When I edit Web application project, Visual Studio 2017 (15.3.1) adds <Use64BitIISExpress /> element under Project/PropertyGroup in csproj file.
I can't find any documentation, what is the purpose and if it affects something, when presented (as it is, without any attributes).
Only result I was able to find was mention about registry value of the same name.
Does someone know what this element serves for?
Was it introduced in some of recent updates of Visual Studio 2017?

I noticed this entry, not surprisingly, after I made a change to the Properties page of the my Project. Under the Web section of the Properties page, you'll see a section called "Servers". After I changed the "Project URL" to use the correct port number for debugging, this entry appeared (not because I changed that option specifically, but it's when I noticed it appearing).
<Use64BitIISExpress />
In this section you can select either "IIS Express" or "External Host". Next to that dropdownlist, there is another dropdownlist for "Bitness". Mine was currently set to "Default", which displays the entry in the Project file as an empty element. After changing the "Bitness" to "x64", my Project file entry changed to:
<Use64BitIISExpress>true</Use64BitIISExpress>
Changing my "Bitness" to "x86" results in:
<Use64BitIISExpress>false</Use64BitIISExpress>
Returning "Bitness" to "Default" makes it again an empty element:
<Use64BitIISExpress>
</Use64BitIISExpress>
I understand this doesn't address your question of "where is the documentation?". I, too, could not find any relevant MSBuild documentation for this attribute. But, I thought it worth noting where the attribute is coming from and how it acts based on selected options from the Project properties while we anxiously await some formal, official documentation.

The purpose of that (pretty obvious) is to start IIS Express in 64bit mode. It is the equivalent of setting 64bit only on the Application pool in IIS.
If your project has a dependency on a DLL that only runs under 64bit mode then this is when you need to set it. This has been available since VS2013
Probably is useful if you prefer to do do F5 debugging instead of
process reattaching for your pure 64bit applications
This started showing up in the config files since VS2017 due to all the changes happening with Visual Studio portability. (VSCode, Visual Studio Mac, Xamarin, etc)

Related

Why is the "add reference" list in my C++-Project in VS2017 empty?

When trying to add a reference to my Visual C++ project in VS 2017 (I chose "empty project" when creating) the list of references to select from is empty, as shown in the following picture (it's in german but I hope it nevertheless gets the point across):
Although I haven't used VS or coded in Visual C++ in the past, I'm fairly certain that the reference list should not be empty and should instead show a list of possible references to choose from.
I have created the project from scratch, just added some existing .cpp, .hpp and .h files. Even when creating a new "windows desktop application" or a "windows console application" the reference list is empty.
I want to work with a MS Access Database (.mdb) via DAO and therefore need to add a reference to the COM Microsoft DAO Object Library as explained here (correct me if I'm wrong).
My problem is nowhere to be found when doing a google search (the only solution provided here doesn't work for me), therefore I created this post and hope someone here can tell me how to fix this issue.
It's empty because you are in the wrong subdirectory. You are under "Solution", and in your solution, there is only one project, AM. If you add another project to the same solution, you'll see it appearing in the list.
You can try to go under the other subdirectory, but I doubt you'll find anything, because you have a non-CLI C++ application, and those applications don't support "references" (it's just not a thing).

Visual Studio 2010 "Setup Project" registry editor doesn't work

I have an installation project that needs to add 1 simple string to the registry, and the built in Registry Editor in the Setup Project doesn't seem to work at all. It puts a base key HKEY_LOCAL_MACHINE\Software\[Manufacturer] by default into the install project, and that doesn't even work.
Here are the steps I used to add the key.
Right click setup project: View --> Registry
A mock Registry is displayed and I drill down creating keys as needed.
I create HKEY_LOCAL_MACHINE\Software\[Manufacturer]\[ProductName]
Run the installer. No errors are reported, but keys do NOT exist.
EDIT: Take a look at figure 5 on this webpage. It shows you kinda of what I see except in what looks like a much older version of visual studio.
I don't see how this could fail, it should be so simple. I've even tried simple keys and it just won't create anything, or at least throw an error. I've seen this solution but its ridiculous to add a post build step to manually edit the registry when there is built in functionality to do it. That post indicates that the feature is just broken, so don't use it.
If you have a 32-bit installer the keys will be redirected under HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ key
More details you can find here: http://msdn.microsoft.com/en-us/library/windows/desktop/aa384232(v=vs.85).aspx

Problem with file name folding in Visual Studio Solution Explorer ("File Nesting")

(Edit for search-ability: called "File Nesting")
I'm not sure if "folding" is the correct term, but the feature I'm referring to is shown in the 1st image below, versus the 2nd one which does not have an expandable tree list node for the code behind file.
Folding:
No folding:
My questions are:
What is the correct name of this feature?
How do I set it?
Why does my Solution Explorer not have this feature enabled when I try to convert my Web Site Project to a Web Application Project?
References:
Upgrading VS 2005 Web Site Projects to be VS 2005 Web Application
Edit
Thanks Sean, but as you can see below, my Nest Related Files button does show up in this project for some reason:
Should have button shown below:
Edit:
I figured out the reason: I accidentally created a C# Web Application Project, and then added VB ASP.NET files to it.
It's called File Nesting.
When a website project is selected in Solution Explorer, the third button in the Solution Explorer toolbar is for "Nest Related Files".
A website project or project file must be selected in Solution Explorer (rather than the root Solution), for the button to appear in the toolbar. The command/tool button is not available when C++/C# projects are selected in Solution Explorer. I don't have a web app project to test but can only conclude that the command is not applicable to web app projects either.
see this related question for a possible registry hack (changing 9.0 to 8.0 in the question's reg script):
Visual Studio 2010 related file nesting
When you are not using a website project, the nesting button in the solution explorer won't appear—but you can still nest files in .NET 5.0 projects.
Here's how you do it:
Open the project's .csproj file. Visual studio can open it in its own viewer, or else you can use your favorite XML or text editor.
Locate or create an appropriate Item Group element. If there's already one that includes some of your files, put it in there for cleanliness and consistency. If there isn't, create a new one.
Create a new Content element for the file you wish to nest. This element's Include attribute should be the name of your desired file.
Add a new DependentUpon child element to your content element. This element's text value should be the name of the file you wish to nest your target file underneath.
Save the project file and Visual Studio will likely prompt you to reload the project. If you did it correctly, your target file should now be nested under your desired file.
There's shockingly few questions and answers that address this situation. The above answer didn't help me, so I figured that I would share what did for posterity.

Error when running projects on Expression Blend 4

Whenever I try to run a project on Expression Blend 4 an error always appear.
The specified solution configuration "Debug|MCD" is invalid.Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p Configuration=Debug / p:Platform="Any CPU" or leave those properties blank to use the default solution configuration )
In some forums I've read that by deleting something on the registry will solve this issue but what I want to know is if it's safe to do that or if there are other ways to solve this error.
It turns out that HP machines from the factory come with several global variables set for it’s own update software, including things such as “PCBRAND”. One of those variables are, you guessed it, PLATFORM.
In VS 2010 RC the build environment started respecting “Platform” as a compile time System variable. Therefore, because no such platform exists in your deployment configuration, it fails.
It’s a pretty simple fix, just delete the PLATFORM variable.
You need to do the following steps:
Right-mouse click "Computer"
Go to "Properties"
Click "Advanced System Settings"
Click "Environment Variables"
Under "System Variables" find "PLATFORM" and delete it.
Restart Visual Studio
Here’s hoping I saved you some time.
If you mean:
http://social.expression.microsoft.com/Forums/en/blend/thread/f664d317-2415-4369-b461-a22eb0a2f023
&
http://social.expression.microsoft.com/Forums/en-US/blend/thread/71496590-a9ec-4e3a-8353-3ced345f78dc/#18af3654-2ee7-4e61-a1e1-321d430026eb
Then yes. It's to do with HP and the way they package up the extra applications on the machine. I found that the MCD platform key was in the registry in a few places, I deleted them and then restarted and now blend builds great.

The Following Module was built either with optimizations enabled or without debug information

I cannot get rid of this in my VS 2008 web project when debugging. I've checked that it's in debug mode on the non-web project in question and it's in Active(Debug). Deleted all items in my .NET 2.0 temp folder in Windows. Not sure what else to do here.
Try disabling "Enable Just My Code" in Tools/Options/Debugging/Options.
I had the same problem and discovered that I wasn't outputting my debug info on my build. If you right click on the project and go to 'properties', then select the 'build' tab, on the bottom of the page there's an 'Advanced...' button that will display your setting for you output debug info. Set that to 'full' and the error should go away.
I just ran into this issue, and quickly decided that the other answers posted didn't apply to me.
I'm the owner of the project, and I know it was built with debug information, as well as without optimizations. Furthermore, I'm never happy choosing the disabling of a warning as my first choice. Hiding/ignoring this warning could become an issue in a future debugging session.
Since this only started occurring after I signed the assembly, this clued me in on my quick fix: temporarily remove the strong name of my DLL (and consuming EXE). Voila! Problem solved.
A better, long-term solution, could take the form of adding a post-build action to update the GAC so it has the latest version of the signed DLL.
But for now, I'm happy to move on from this diversion, and continue working on the issue that brought me to this debugging session.
resolved. Deleted all occurences (all projects) of the dll in question.
VS2012, clean and rebuild fixed the issue for me. "Properties" -> "Build" -> Optimize code is unchecked. "Properties" -> "Build" -> "Advanced" -> Debug Info: Full
Check out this link
http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/43cb16ba-0759-42ab-8e7d-9f168ace3b6f
try unchecking "Just My Code" in Tools->Options->Debugging->General.
it works for me
Guessing VS 2008 is not rebuilding the dll correctly.
1) Delete all occurrences of the dll
2) Rebuild solution
And that should fix it.
Check your build configuration options. Make sure optimizations are turned off and the DEBUG constant is defined.
If everything else fails, try renaming the Assembly name in the project's properties. This fixed the issue for me.
I get this issue as well, for some reason it's happened 3 or 4 times; I think it must be a Visual Studio 2005 bug/hick up (or at least my installation).
This has worked every time: to fix it I
Right click on my solution and click Properties.
Open Configuration Manager.
Select Debug in the drop down menu (if not already selected).
Uncheck BUILD. Then re-check it.
Rebuild the solution.
Tools > options > Debugging > Symbols > Specify excluded modules
look that if the dll or the exe in the excluded modules list
At least for non-web applications this works:
From: http://www.stellarpc.com/articles/board.aspx?id=40
2 - Allow Debugging...
Due to the nature in which one of the assemblies has been built in your application, you will need to change a few settings to allow the code to be handled by the Visual Studio Debugger.
Right click on any project in question from the solution explorer and select 'Properties'. This will open up the project properties panel giving us access to a great many options for our projects. Navigate to the 'Complile' Tab (or 'Build' if your in a C# environment) and select 'Advanced Compile Options...' from the bottom of the screen. This presents us with a prompt that has two key areas of interest:
1) Optimizations - uncheck 'Enable Optimizations'
2) Generate debug info - Ensure that the option is set to 'Full'
I had this issue with a solution in a certain folder, but if I moved it to another folder or others built it, I didn't get the message. I did the clean, rebuild, and even rebooted and still couldn't get the original to debug without this message. I searched my system for copies of the file causing the error and I found that copies were kept in
c:\User\username\AppData\Local\Assembly\dl3
This was on Win7-64 but will be similar on other Windows OSes. I deleted all of the copies I found there and I no longer get the message. I didn't need to uncheck the "Enable Just My Code".
Also, this was for a WPF app, but I came across this thread in my search so hopefully this will help someone else.
I was able to resolve this issue by following these steps:
Right-click on the Solution (not the Project), and select 'Properties'
In the left panel, select 'Configuration Properties'
In the right panel, select 'Debug' under the 'Configuration' column for your project
If you do not see the Solution listed in Solution Explorer, follow these steps:
In the menu bar, go to Tools -> Options
In the left panel, select 'Projects and Solutions' (you may need to check 'Show all settings' at the bottom-left area of the window
In the right panel, check 'Always show solution'
I hope this helps.
I too have all these. And I've done all this. It appears this happens to me every time I get a fresh copy of the entire solution out of source control. So if we've done all these, deleted dlls & .pdb files for all references (Assemblies) in the web project, used the clean option on the solution, deleted temp files, closed out VS and reopened, made sure debug mode is selected and set at full and optimations are off, what more is there?!?!?!
I had the same issue on my web project in Visual Studio 2010, and finally I found the reason why I was getting this message. What I did was to change an existing debugging option on Visual studio:
Go to Tools->Options->Debugging->Symbols->All modules
Check the "unless excluded" radio button
Click on the link "Specify excluded modules", then remove the DLL that you want to debug.
In my case it was my web dll file...
I had this when trying to remote debug an application on a computer that belongs to a different subnet. I was able to debug and step through the code when running it across the network if the machines were on the same subnet. After changing the subnet though I was unable to step through when running from the network and was getting the "The Following Module was built either with optimizations enabled or without debug information".
The solution? Easy. Copy the built solution across to the machine hosting the remote debugging and run it locally.
Had this happen to me on a VS 2010 winForms project. Seeing that the majority of people here have web projects, i think that it has to do with access to the folder in which the project is stored. I say this because when this problem occurred to me Google Drive was synchronizing the folder in which i keep my projects. It seems that just disabling the synchronization does not fix the problem.
My solution is similar to one of the answers above:
Went to "Project Properties > Compile > Advanced Compile Options"
Checked "Enable optimization"
Set "General debug info:" to "None"
Unchecked "Define DEBUG constant"
And pressed OK
Then went back and returned the options to their initial state.
Hope this helps someone as it seems this still happens.
Follow this : (first STOP debuging)
1:right click on project solution name or project -> Properties
2:under Configuration Properties select configuration Manager
3:Change configuration to debug and click on close
4:Change configuration to debug and click on Apply -> OK
Now rebuild solution....!
For me, Checking the "Optimize code" box in the project properties, saving, unchecking it, then resaving did it for me.
Disabling "Enable Just My Code" also worked, but that was more of a work-around than a fix as I didn't want that setting.
I have had same problem, but with different cause and solution.
The window was the same as that shown by Gustavo (above) but the path was in:
"\users\zzz\AppSettings..." (where zzz is windows username)
I had an Excel addin - I was testing the install of the addin, so I had a copy installed through VS install function. VS was obviously trying to debug both the installed copy and the copy I had just launched, and could not find debug symbols on the installed copy.
None of the above solutions worked (without side affects),
SOLUTION:
uninstalling the addin, and manually deleting the files in App Settings worked.
You mentioned it's a web project...do you have
<compilation debug="true />
in your web.config?
I had the same problem after building with a Release configuration.
It turned out that when I switched back to Debug, VS wasn't detecting any differences, so it was not updating the .dll and .pdb files in the bin folder.
Here's what worked for me:
Run iisreset (to clean up the temporary folders)
Save the web.config (to force VS to actually rebuild)
Rebuild on Debug
Start the project
Try a rebuild then debug.
My case is following: webservice referenced lib1.dll. Later I removed reference as it was no longer used. However lib1.dll remained in the bin folder.
Because library was not referenced then Rebuild and Clean actions were not helpful.
After manually deleting lib1.dll from bin folder I've get rid of this message.
If you are publishing to IIS and not using built in web server -or IIS express- make sure that your publish profile settings is in debug mode. In vs 11 by default it's in release mode.
Just to add, I was looking at this blog to find the solution to the same problem I was facing. Unfortunately the solutions mentioned above didn't help me. At last I figured out, I was installing my bits (along with .pdb) through installer and setting permission explicitly on the installation folder.
Because of which VS was not able to load the pdb even though the file browser was showing the correct file but it was giving the same error mentioned above.
Once I unchecked "Enable Just my code" and removed permission settings from the installer, VS started loading the module.
The one configuration that worked for me was the following
Project --> (Your Project) Properties --> Debug Tab
make sure Configuration is set to Active (Debug)
Under "Unable Debuggers", make sure "Enable unmanaged code debugging" is checked
I'm creating a Windows Service and here's what worked for me:
Uninstall the service.
Open a command prompt and go to c:\Windows\Microsoft.NET\Framework64\v4.0.30319
installutil C:\MyFantabulusWindowService\bin\Debug\MyFantabulusWindowService.exe
Greatness has been achieved!
Case : testing assembly with Console project in SharePoint development - if you're doing SharePoint development and seeing this alert in VS, make sure you deploy your SP assembly to the GAC before testing your console app IF your core SP project has methods you need to call in your console test app.

Resources