Showing posts with label Visual Studio. Show all posts
Showing posts with label Visual Studio. Show all posts

Wednesday, January 29, 2014

Default parameter specifiers are not permitted

This error started appearing in our Cruise Control .NET build. However, we were not getting any errors from Visual Studio in the development environment. We are targeting .NET 3.5, and it turned out some methods were using optional parameters, which do not exist in .NET 3.5. However, Visual Studio is smart enough to be able to compile the code, but csc.exe (which is used by CC.NET) is not. We had to remove the optional parameters and to make sure it didn't happen again, we set the Language Version to C# 3.0 in Project Properties -> Build -> Advanced -> Language Version. Check out this post for more detailed information

http://engineering.thetrainline.com/2013/06/20/using-visual-studio-2010-to-target-net-3-5/

Monday, August 13, 2012

TFS Agile Template error "Report execution has expored or cannot be found"

I always wonder why some errors simply disappear by closing and opening an application. This error happened when I tried to open the Sprint Burndown report from Visual Studio 2010. After investigating a couple of hours, I read that just re-opening Visual Studio fixed the problem. And it did!

Wednesday, September 14, 2011

Microsoft Visual Studio Scrum 1.0... sucks

I've used Rally and JIRA to manage Scrum projects. This last time I decided to give the Visual Studio Scrum template a try and... it's just not what I expected. One of its major drawbacks is the inability to do time tracking. Some people might say that doing time tracking in Scrum is not beneficial and even useless. This might be true for internal projects, but with external clients you need a way to know how much work you've spent on a project (and if you're running out of the initial allocated hours).

Anyway, I'm going to test the MSF for Agile Software Development Process Template. Hope it offers more than the Visual Studio Scrum template.

Tuesday, April 19, 2011

Breakpoints don't work when debugging a dll in ArcMap

Has this ever happened to you? It's really annoying, because one moment is working, the next one it's not. After doing some searching, it turns out there's an ArcMap configuration file -ArcMap.exe.config- that you need to modify. Just change the version from 2.0 to 4.0 and voila!

http://social.msdn.microsoft.com/Forums/en/vsdebug/thread/22d4c3d3-bf77-40ed-8b1b-64223019f3f1

Friday, April 1, 2011

Running Visual Studio 2010 as an administrator

Lately it's been driving me crazy that when I open an existing Visual Studio solution, it won't open Web or WCF projects because Visual Studio was not run with admin privileges. Time to do something about it!

Check out this link. Basically, you need to check the "Run as an Admin" option in the properties of the VS2010 application. Pretty simple huh?

Monday, October 11, 2010

Visual Studio 2010 Extensions

There is a great new feature on Visual Studio 2010 called Extensions (that I just discovered haha). It's pretty cool, specially since there is a gallery from where you can download extensions. My favorite one right now is JSLint. If you are also doing JavaScript development, you'll find it useful as well.

To get started on this new feature, go to Tools and then click on Extension Manager.

Saturday, June 26, 2010

WCF Client code is emtpy: Referenced type cannot be used since it does not match imported DataContract. Need to exclude this type from referenced type

Adding a WCF service to a web project ran successfully, but it didn't generate any client classes. I noticed a "silent" warning was generated in Visual Studio 2008 (mentioned in the title of the post), and in order to fix it, I did the following (from this link):

1) Click Advanced in the dialog shown while adding a Service Reference
2) Uncheck "Reuse types from referenced assemblies"

Wednesday, June 23, 2010

Postback doesn't fire when radiobutton is defaulted to checked

This was really strange behavior. I am using an UpdatePanel to trigger a partial postback, and by just setting Checked to true the RadioButton would not trigger a postback. I ended up moving the RadioButtons inside the UpdatePanel, and this fixed the problem.

Is there a logical explanation for this or is this a "feature" (bug)?

Sunday, May 23, 2010

MSI project: Unable to build project output group Content Files from MyProject (Active)

If you get this error, it's because the solution project indicated in the error message could not find some files. Enable "Show all files" using the Solution Explorer and check which files are missing (look for a yellow warning icon). More information can be found here.

Friday, April 16, 2010

Debugging custom actions in a Visual Studio 2008 installer

It's simple. Just add the following:

public override void Install(IDictionary stateSaver)
{
Debugger.Break();
...

In order for this to work, I also had to (obviously) build the installer in Debug mode and make sure that Debugger.Break was the first statement in Install(...). This article was really helpful http://harriyott.com/2007/02/debugging-custom-actions-in-visual.aspx

Thursday, September 10, 2009

Overloading web methods in Visual Studio 2005

It's really simple, you just need to replace

WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

with

[WebServiceBinding(ConformsTo = WsiProfiles.None)]
I found this information here.

Friday, April 24, 2009

Cross-thread operation not valid: Control 'Ctrl' accessed from a thread other than the thread it was created on

I though I would have to redesign part of the application, after all, this seems like a critical error. But if you come across this error, check out this link:

http://www.vcskicks.com/cross-thread.php

Delegates can fix it. The code below will help you (part of this code is from the website above).

 
private delegate void AddListBoxItemDelegate(object item);
... then copy this code inside your method...
if (this.InvokeRequired)
{
AddListBoxItemDelegateaddItemDel = new AddListBoxItemDelegate
(AddListBoxItem); //delegate
object[] parameters = { text }; //parameters
this.Invoke(addItemDel, parameters); //call
}

else

{
//code you want to execute
}

Wednesday, June 18, 2008

VS2005 and wchar_t

While upgrading a VS2003 solution to VS2005, I received the following error:

Error 29 error LNK2028: unresolved token (0A001D22) "public: void __thiscall osgText::TextBase::setText(unsigned short const *)" (?setText@TextBase@osgText@@$$FQAEXPBG@Z) referenced in function "private: class osg::Node * __thiscall XXX::YY::ZZZ::FFF::WWWW(class XXX::YY::ZZZ::FFF::CCC &,class osg::Vec4f const &)" (?KKKKK@TTTTT@CCCCC@YY@XXX@@$$FAAEPAVNode@osg@@AAVGGGGG@234@ABVVec4f@6@@Z) RRRRRR.obj

My first thought was to make sure I had the correct version of the OSG libraries. They were OK, so then I googled some keywords of the error message and came across something interesting. VS has an option in Tools->Options that is "Treat wchar_t as built in type". My default value was false, so I set it to "Yes" and rebuilt the libraries. It worked!

Monday, April 28, 2008

Stack overflow at line: 0

While debugging an ASP.NET application I got the error: "Stack overflow at line: 0". This happens just after adding a new line of code to a javascript file. Then I thought this article forums.microsoft.com/MSDN/ShowPost.aspx could be related. However, the code indicated in the article was already implemented in the website.

The error appears in both IE7 and FireFox 2.0 in debug mode. However, in the deployed website the error was not appearing. Does it mean the error exist or not? Is it possible this issue is related to VS2005 and not to the javascript code I added?

Tuesday, February 5, 2008

IServiceProvider error: ambiguous symbol message

I have been working on porting code from VS2003 to VS2005. The last error message I received before being able to compile it was:

error C2872: 'IServiceProvider' : ambiguous symbol

Lucky me, this error is well documented. The solution was moving the #include to the top of the file. It works for me and I did not look further on the cause of this error. However, it seems this symbol may be declared in more than one file.

This is one area where Microsoft could follow ESRI's approach. ESRI does not declare repeated names, it adds a number to the end of the class that can be incremented, i.e. ISpatialReference, ISpatialReference2, ISpatialReference3. Note that ESRI is actually extending a class with each increment and Microsoft may not be doing that.

Tuesday, January 22, 2008

External tools to support VS2005

There are two tools I have been using lately along with Visual Studio 2005. One of them is .NET Reflector which you can download here.

The second tool is FileMon. Find it here. It is a great tool that can tell you the folder paths where Visual Studio is looking for a file and whether it finds it or not. Both of these applications are free.

Finally, another tool is TestDriven.NET. It can help you debug your unit tests if your are using TDD. It works great with NUnit, but there is a small fee to pay.