Category: visual-studio

Sep 26 2013

Weird behavior when opening web project in Visual Studio 2012

        <p>I have a solution with a web project (the "main" project - lets call it the DataPortal project.) where the project will not open unless take the following steps.</p>
  1. Open solution. The DataPortal project is greyed out and says "Unable to open project".
  2. Right click the DataPortal project node and choose Edit DataPortal.vbproj
  3. Change the UseIIS node in the project from True to False. Save the file.
  4. Right click the DataPortal project and choose Load Project. The project loads.
  5. Now open the DataPortal project files Property page. (Alt-Enter)
  6. Check the option button in the Property sheet that says Use Local IIS Web Server.
  7. Check the checkbox that says Use IIS Express. The Project Url already has a value in it.
Now everything works great. And I can work until I shut down VS but when I re-open the solution I have to go back through it all again. Can anyone tell me how to fix it so that UseIIS is okay at startup? Is there some way to get insight into the project load error for more information about it?
May 03 2012

How do I troubleshoot Visual Studio which is hanging when loading ASP.NET MVC project?

Yesterday I worked on an MVC 3 project in Visual Studio 2010 and then shut down Visual Studio before leaving work.

This morning when I try to load the same project in Visual Studio the project hangs. I have restarted my computer, disabled all add-ons and extensions that I could. Still no banana.

I have no idea how to troubleshoot this. I would try to clean the solution if I could get it to load but I can't. (Can I clean the solution from the VS command window?).

Any help would be greatly appreciated. How do I troubleshoot this?

Seth

May 03 2012

How do I troubleshoot Visual Studio which is hanging when loading ASP.NET MVC project?

Yesterday I worked on an MVC 3 project in Visual Studio 2010 and then shut down Visual Studio before leaving work.

This morning when I try to load the same project in Visual Studio the project hangs. I have restarted my computer, disabled all add-ons and extensions that I could. Still no banana.

I have no idea how to troubleshoot this. I would try to clean the solution if I could get it to load but I can't. (Can I clean the solution from the VS command window?).

Any help would be greatly appreciated. How do I troubleshoot this?

Seth

Jan 27 2011

For a .NET winforms datagridview I would like a combobox column to have a different set of values for each row

I have a DataGridView that I am binding to a POCO. I have the databinding working fine. However, I have added a combobox column that I want to be different for each row. Specifically, I have a grid of purchased items, some of which have sizes (like Adult XL, Adult L) and other items are not sized (like Car Magnet.)

So essentially what I want to change is the DATA SOURCE for a combobox column in the data grid. Can that be done?

What event can I hook into that would allow me to change properties of certain columns FOR EACH ROW? An acceptable alternative is to change a property when the user clicks or tabs into the row. What event is that?

Seth

EDIT
I need more help with this question. With Triduses help I am SO close but I need a bit more information.

First, per the question, is the CellFormatting event really the best/only event for changing the DataSource for a combo box column. I ask because I am doing something rather resource/data intensive, not merely formatting the cell.

Second, the cellformatting event is being called just by having the mouse hover over the cell. I tried to set the FormattingApplied property inside my if-block and then I check for it in the if- test but that is returning a weird error message. My ideal situation is that I would apply change the data source for the combo box once for each row and then be done with it.

Finally, in order to set the data source of the combobox colunm I have to be able to cast the Cell inside my if block to a type of DataGridViewComboBoxColumn so that I can fill it with rows or set the datasource or something. Here is the code I have right now.

Private Sub ProductsDataGrid_CellFormatting(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles ProductsDataGrid.CellFormatting

    If e.ColumnIndex = ProductsDataGrid.Columns("SizeDGColumn").Index Then ' AndAlso Not e.FormattingApplied Then
        Dim product As LeagueOrderProductInfo = DirectCast(ProductsDataGrid.Rows(e.RowIndex).DataBoundItem, LeagueOrderProductInfo)
        Dim sizes As LeagueOrderProductSizeList = product.ProductSizes
        sizes.RemoveSizeFromList(_parentOrderDetail.SizeID)

        'WHAT DO I DO HERE TO FILL THE COMBOBOX COLUMN WITH THE sizes collection.

    End If

End Sub

Please help. I am completely stuck and this task item should have taken an hour and I am 4+ hours in now. BTW, I am also open to resolving this by taking a completely different direction with it (as long as I can be done quickly.)

Seth

Jan 27 2011

How do you create Winform user control that supports multiple items like a listbox.

Hello,

I think I understand the basics of create winforms user control. I can do Add New and select user control and that will give me a design surface and designer file and code-behind file etc. And then I could change it to inherit from something other than UserControl (like listbox or text box).

The thing that is different for me this time is the user control needs to be a list control (like a list box) that can be data-bound and with two data-bindable controls in it (two combo boxes).

I am not sure where to start? Can anybody reference a document or some obvious bit in the tooling that I am missing that will make it quick and easy? Any approaches I can take like extending an existing control. Any gotchas I need to be aware of?

Thanks.

Seth

Jan 27 2011

How do you create Winform user control that supports multiple items like a listbox

I think I understand the basics of create winforms user control. I can do Add New and select user control and that will give me a design surface and designer file and code-behind file etc. And then I could change it to inherit from something other than UserControl (like listbox or text box).

The thing that is different for me this time is the user control needs to be a list control (like a list box) that can be data-bound and with two data-bindable controls in it (two combo boxes).

I am not sure where to start? Can anybody reference a document or some obvious bit in the tooling that I am missing that will make it quick and easy? Any approaches I can take like extending an existing control. Any gotchas I need to be aware of?

Thanks.

Seth

EDIT
I have decided to take a different approach. I am leaving the question up, though. This is clearly difficulty than I had guessed. WPF is not an option for me unfortunately. Just gonna use a data grid.

Jan 13 2011

How come the .NET framework 3.5 offline installer is 200 MBs larger than the .NET 4 offline installer?

Hello,

I have code/support an application built on .NET framework that has always run on .NET 2. This year we are upgrading the application to use .NET 3.5 (or 4?).

In preparing for this change we noticed that that Offline Installer (required for our customer base) for .NET 3.5 is 200+ MBs bigger than the .NET 4 offline installer.

Here are my questions.

Why is the dotnet 3.5 installer so much bigger than the 4 offline installer?

Can we TARGET .NET 3.5 but distribute .NET 4. In other words, is .NET 4 backwards compatible? Assuming that .NET 4 was the only installed .NET could application still target earlier frameworks?

IF our application is compiled for x86 CPU (rather than Any CPU) do you still have to distribute the x64/x86 Client Profile or can we just distribute the x86 Client Profile? In other words, can we distribute the x86 Client Profile even though it will be installed on x64 machines if our app is compiled for x86 target CPU? Any risks or gotchas for doing this?

The issue is that if we upgrade our app to target .NET 4 there are a lot of application servers that we also have to upgrade which effects a number of other applications. Any thoughts?

Seth

Jan 13 2011

How come the .NET framework 3.5 offline installer is 200 MBs larger than the .NET 4 offline installer?

I have code/support an application built on .NET framework that has always run on .NET 2. This year we are upgrading the application to use .NET 3.5 (or 4?).

In preparing for this change we noticed that that Offline Installer (required for our customer base) for .NET 3.5 is 200+ MBs bigger than the .NET 4 offline installer.

Here are my questions.

Why is the dotnet 3.5 installer so much bigger than the 4 offline installer?

Can we TARGET .NET 3.5 but distribute .NET 4. In other words, is .NET 4 backwards compatible? Assuming that .NET 4 was the only installed .NET could application still target earlier frameworks?

IF our application is compiled for x86 CPU (rather than Any CPU) do you still have to distribute the x64/x86 Client Profile or can we just distribute the x86 Client Profile? In other words, can we distribute the x86 Client Profile even though it will be installed on x64 machines if our app is compiled for x86 target CPU? Any risks or gotchas for doing this?

The issue is that if we upgrade our app to target .NET 4 there are a lot of application servers that we also have to upgrade which effects a number of other applications. Any thoughts?

Seth

Sep 22 2010

Visual Studio – how do you use it without touching your mouse?

I am going to be doing the codekata defined on Roy Osherove's blog HERE.

One of the rules is that you cannot use the mouse while doing the kata.

Today, my first attempt at doing the kata I have spent the whole time trying to better understand how to use VS without the mouse. I have learned that CTL-ALT-A will be my friend because I can type commands there.

Does somebody have a pointer to a complete reference to the VS Commmands. I want the command name (Edit.ToggleBookmark), command keystroke (like Ctl-K,K), and any arguments required by the command.

Some specific questons I have.

  • Does someone know a keystroke for pinning the active window without using the mouse.
  • Also, I cannot figure out how to add a reference without using the keyboard.

If you can help with those two then I will be significantly farther along.

Thanks.

Seth

edit

Just figured out how to add references. I was working on a project that was not saved and Add References command (Project.AddReference) was returning an error...and I thought it was because I was using the command...but it was actually because I had not saved the project yet.

SO.... if you could help me with the window pinning that would be great.

Seth

EVEN WITH ALL THE HELPS FIGURING OUT COMMANDS...I still cannot figure out how to
- pin a Visual Studio window so it stays open.
- And how do you trigger the context menu any a window. For example, solution explorer?
- How do you delete or remove a file?

EDIT

This StackOverflow question answers the context menu question.

Now...if someone can tell me how to pin a window. That would be awesome.

Seth

Sep 22 2010

Visual Studio – how do you use it without touching your mouse?

Hello,

I am going to be doing the codekata defined on Roy Osherove's blog HERE.

One of the rules is that you cannot use the mouse while doing the kata.

Today, my first attempt at doing the kata I have spent the whole time trying to better understand how to use VS without the mouse. I have learned that CTL-ALT-A will be my friend because I can type commands there.

Does somebody have a pointer to a complete reference to the VS Commmands. I want the command name (Edit.ToggleBookmark), command keystroke (like Ctl-K,K), and any arguments required by the command.

Some specific questons I have.

  • Does someone know a keystroke for pinning the active window without using the mouse.
  • Also, I cannot figure out how to add a reference without using the keyboard.

If you can help with those two then I will be significantly farther along.

Thanks.

Seth

edit

Just figured out how to add references. I was working on a project that was not saved and Add References command (Project.AddReference) was returning an error...and I thought it was because I was using the command...but it was actually because I had not saved the project yet.

SO.... if you could help me with the window pinning that would be great.

Seth

EVEN WITH ALL THE HELPS FIGURING OUT COMMANDS...I still cannot figure out how to
- pin a Visual Studio window so it stays open.
- And how do you trigger the context menu any a window. For example, solution explorer?
- How do you delete or remove a file?