New answers tagged

1

The Visual Studio designer is a 32-bit application and therefore cannot load the 64 bit DLL. The reason it runs fine is that you are running as 64bit I.e. design and runtime are different architectures. Generally when importing a native dll you write a wrapper class for the P/Invoke and then everything references that wrapper class (likely a static class). ...


0

LisenseAdminApi is a DLL also written by our company, just in a different department and it was developed in C++. It requires a Visual Studio 2015 C++("Microsoft Visual C++ 2015 Redistributable (x64) - 14.0.23918") runtime to run. How about you go and ask the Developers who created the DLL how it's supposed to be used? Or, (Shock; Horror) read the ...


1

In addition to the other fine answers, we should consider the separate yet closely related notions of variable lifetime, variable scope, and access permission; let's consider them relative to concept of global, static, and local variables. Teasing these apart will allow us to analyze some of the differences in declarations. And the point that @JacquesB ...


1

Trying to think of an example where local variables are nescessary rathet than just good practice. Consider a shopping basket with items and tax. Global double CostOfShopping AddItem(item) { CostOfShopping += item.price } AddTax() { CostOfShopping =* TaxRate } So the order in which we add items and calc tax can change the cost of shopping. ...


4

Your unit tests are in a separate project and serve a separate function from your main code, so putting them into a separate namespace makes the most sense to me. If you're considering putting them into the same namespace just to save the using line, then don't. Less code is good, clearer code is better.


3

A global variable allows different components to communicate by reading from and writing to a common memory location. In this way, different components are dependent on each other / coupled: each component has expectations about the values contained in the global variable, and all other components must fulfill these expectations if you want your program to ...


12

This is a great question! Much programming advice and "best practices" comes down to the question of managing complexity. Or to put it plainly: How do we write and manage a large complex program without being overwhelmed. The solution is (like with most large problems) to split it into smaller, more manageable pieces. Each variable is a bit of complexity, ...


0

I think you are doing great by splitting your Visual Studio Solution into several Projects that are creating libraries - as you and @antlersoft said in the comment. This way you can have several other Solutions or even projects that create a standalone binary (like command line exe) referencing these library (Solution Explorer: add reference). The one ...


1

You have two options. Create seperate mywebsite.api and a mywebsite.app projects in your solution. Advantages Proper seperation of concerns. You can delploy updates to your api and your front end independently. Architecture of sites can be changed independently (i.e. you can update your api to run on asp.net 5 without affecting the website) Cleaner ...


3

I would suggest you rather use a Win Form app for game. If you use Console you will need to refresh (clear and redraw) the console each time you want to change display - that is with change in each second. On a win form you can directly put a timer control and start the timer on game start (button click, form load - as per your need). When timer tick event ...


1

I recommend a Single Solution Approach -- especially for the start of a new project. (You can get more complicated later on, iff you need to.) MS itself has ought to say on that matter: Structuring Projects and Solutions v2002 Structuring Projects and Solutions v2007 My experience is (as MS says): This structure simplifies development because all of ...


0

You can probably make it work. But, I find when using coded UI, or other test frameworks you are quite dependent on changing the code to make the various buttons and other elements easy to pick out and interact with. I think you will find it easier to just buy an off the shelf automation product


1

Well, obviously you can seperate them into two solutions, add another project in solution, or have them in same project. I will tell what I would. IMHO, if you want to take advantage of Sessions in IIS and/or hide authentication process within API, write angular in Visual Studio as well. VS2015 has a pretty good integration(intellisense) with angular if you ...


1

If you are into TDD, I suggest you write up a test which will fail until the functionality gets implemented. The only downside I can see is if you are a somewhat lazy function such failing tests will contribute a lot of noise to runs and may hide actual failures behind all that.



Top 50 recent answers are included