VS2015 Multiple startup projects - prevent page showing - visual-studio

I have recently had to reinstall my development machine so I'm unsure how I did this before.
A solution which I have currently has 3 projects that are needed for startup for debugging, this works fine, when I run the solution I get 3 pages open up in the browser which makes logical sense, however on my previous installation of my machine I only had one page open up, the API and MVC projects didn't show in the browser, but they were running so the entire application worked.
Is there a way to suppress the unneeded pages from opening up in the browser?

I found the option after a while, it was in the project properties, not the solution properties!
Here are the details if anyone is interested:
Right-click on the Project
Choose Properties
Go to the Web tab
In the Start Action section select the 'Don't open a page.
Wait for a request from an external application.' option.

Related

Adding WebApi Project to existing ASP.NET Webforms Application

I have an existing ASP.NET Webforms Application (see image below), and I've added a new WebAPI project. I have a few issues. The first is that according to various tutorials, it should just work, but alas...well, it does work when I right click on the project and Start New Instance in Debug mode. Right now, I have a single project set to start, but it doesn't activate the WebAPI project, and I would like it to. I know that I could set them both as startup projects, but then they end up in different browser windows, which is not what I want.
I would like to know how to get this second project to also start when starting the first, but in the overall solution sense. That way I can start my main site, but also hit the api/Donation url.
Right click on your Solution and select Project Dependencies.
Tick Donate for the shop.scramble.org project.
Run the Solution and you'll see in IIS Express both applications are running.

Debugging from a View file

Working on a C# MVC project, I can have multiple files open in Visual Studio. When I press F5 to start debugging, the debugging starts if the currently open file is:
a controller (*.cs);
a model (*.cs);
a stylesheet (*.css);
a config file (*.config);
a partial view (*.cshtml)
However, if the open file is a View (*.cshtml), the browser opens with the "Server Error - URL not found" page.
Additional info: The solution has always been under source control with SVN but at some point, the repository location changed and from then on (I think), this strange error occurs. It didn't happen before, I could debug without thinking if a view file was open or not. The change wasn't performed by me and I lack details on it. I am not sure these things are related either.
Anyone has come across a similar issue? How to solve it?
I am guessing the problem is your project setup. Do following:
Project right click -> Properties -> Web -> Start action
Most likely it has "Current page" checked, which does not play well with ASP.NET MVC view, it just tries to open the view directly, and not via route. Every other type of file you mentioned is not detected as page, and thus VS does not try to open them as such.
You might want to choose a "Specific URL" there, or just make a habit of switching to a different file before hitting F5.

Files not uploading via Aptana 3

I'm new to Aptana 3. I recently switched from using an FTP (Filezilla) and text editor just to speed the file editing process up a bit.
I'm dealing mainly with Wordpress sites on a shared Godaddy hosting account, and am having some trouble uploading the files I have edited via Aptana to my live site.
i.e. I've edited several lines in my "main.css" file. I save it in my "Project Explorer" window in Aptana, have my FTP connection all set up and working, and click the "Upload" icon. I refresh my browser and nothing has changed, and I can see the website is still pulling in the old css. I've also tried "synchronizing" my files and hitting the "Publish" button, but that doesn't work either?
I've also tried just editing the file in a new Remote Connection tab, but no joy either.
I've hunted all over for simple walkthrough for deployment or file sync guides for Aptana, and watched a few video tutorials but nothing has worked so far.
Hold Control+F5 for a few seconds in your browser. You probably are just running a cached version of the CSS in your browser. That should prune it.
I had the same problem. What I found I had to do was an initial synchronization, I know you mention that you did this but it may be that it didn't fully sync as its not always clear what is going on with the Aptana sync.
What I did:
Make sure your Project has a connection in it and that it points to the server location that you want to sync with
Select the Remote tab and right-click on a file within the chosen connection, choose File Transfer...
This will open the sync window and it will initiate a compare, this is where confusion set in for me, if the folder structure is not identical it will propose to create and delete lots of files. I found I was deselecting items to be safe but meant that it did not correctly sync. Make sure you are syncing from the same root level and then let it do a full sync, this seems to register or record a link between the local and remote files.
Run the sync. when it is complete you will now be able to upload individual files successfully from the Project tab using the upload icon (before a successful sync this will not work - even though it looks like it is doing an upload).
Hope this helps.

How to develop a VS2010 Silverlight Business Application without it caching the .xap file?

In Visual Studio 2010 I've created a Silverlight app by choosing the "Silverlight Business Application" template.
I changed some code in Home.xaml.cs, closed Visual Studio, opened it again, and began making more changes.
But now the changes that I make to the code don't take effect at all. It's as if the entire application is cached. I can even delete the whole contents of the Home.xaml.cs file so it is blank, and pressing F5 shows me my original Silverlight app. This happens both in Firefox and Chrome. I've rebuilt, deleted the bin directory, but it keeps showing me the same old application.
What do I need to change in this template so that I can make changes to the code, and see them reflected in the application?
Addendum:
I created a new Silverlight Business App, copied all the code to it, and this caches after the first change as well.
So it occurred to me to go into BusinessApplicationTestPage.asp and chang the link to the .xap file:
<param name="source" value="ClientBin/BusinessApplication4.xap?id=111"/>
So i've "fixed" the problem in that I change the id each time I run the application. And I suppose I could put a random number generator in here so that it refreshes each time. But... is this the intent? Isn't there an easier way to develop without this caching, and then only when deploying to cache like this?
Update:
Ok, just by adding that ?id=111 once, it recognizes each change now. Perhaps...
Start by using Control-F5 in IE. This not only refreshes the page, it clears the browser cache so in theory you will download a new version.
If weirdness like this is still happening you need to delete the contents of these folders...
C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
This is such a well known pain-point in older versions of Visual Studio that most web developers I know have batch files specifically for cleaning out those directories.
These folders exist so that you can alter ASP.NET applications while the application is still running. IIS will detect the changed files and copy them to the temp directory while it silently restarts your web site. Alas this doesn't always work correctly, especially when running under the IDE.
I know this isn't an ideal solution, but I have found that the IE9 Beta caches XAPs much less aggressively than other browsers, and I don't face this problem when running my Silverlight applications in it.

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