Showing posts with label Visual Studio. Show all posts
Showing posts with label Visual Studio. Show all posts
0
Summary of Technical Summit (Keynote)
Visual Studio online for project management, TFS
http://aka.ms/vsosecurity (microsoft security)
Some Shortcuts in visual studio
--------------------------------------------------------
Track active item in Solution explorer
Navigate To (Ctrl+comma)
Scrollbar (User map mode for vertical scrollbar)
Ctrl F10 (Run to Cursor)
http://en.wikipedia.org/wiki/HTTP_pipelining
OWIN defines a standard interface between .NET web servers and web applications.
Katana - OWIN implementations for Microsoft servers and frameworks
Open application insights is analytics for online projects
--------------------Xamarin------------------------------
Xamarin forms is available for business accounts, On Xamarin forms standard control can be used and it will replaced by device user control, Xamarin forms dont have UI designer currently.
PCL = Portable class library as a share library in Xamarin project
Yumtoso is an example of Xamarin project which is online ( A universal App)
http://winstoredev.com/yumtoso-fastfood-app/
Xamarin generate pure Objective C code
NO IL-code
.Net runtime
Genymotion is an android simulator on MAC os
Mobile web app ui design
http://www.telerik.com/kendo-ui1
Apache Cordova is a set of device APIs that allow a mobile app developer to access native device function such as the camera or accelerometer from JavaScript. Combined with a UI framework such as jQuery Mobile or Dojo Mobile or Sencha Touch, this allows a smartphone app to be developed with just HTML, CSS, and JavaScript.
Bower.io is a package manager for web
ionic
npmjs package installer
http://www.visualstudio.com/en-us/explore/cordova-vs.aspx
Cross platform application
Tools for Apache Cordova Update: iOS Debugging & Windows 8.1 Support
Video Presentation
--------------------------------------------------------------------------------
asp.net Next version
http://www.asp.net/vnext
http://www.asp.net/vnext/overview/aspnet-vnext/vc
http://www.asp.net/vnext/overview/aspnet-vnext/aspnet-5-overview
http://msdn.microsoft.com/en-us/library/dn481095.aspx
Announcing ASP.NET features in Visual Studio 2015 Preview and VS2013 Update 4
Release management for visual studio 2013
----------------------------------------------------------------------
Some related video can be found on Channel 9 http://channel9.msdn.com/Events/TechEd/Europe/2014
News about .Net Open source
Summary of Technical Summit (Keynote)
Visual Studio online for project management, TFS
http://aka.ms/vsosecurity (microsoft security)
Some Shortcuts in visual studio
--------------------------------------------------------
Track active item in Solution explorer
Navigate To (Ctrl+comma)
Scrollbar (User map mode for vertical scrollbar)
Ctrl F10 (Run to Cursor)
http://en.wikipedia.org/wiki/HTTP_pipelining
OWIN defines a standard interface between .NET web servers and web applications.
Katana - OWIN implementations for Microsoft servers and frameworks
Open application insights is analytics for online projects
--------------------Xamarin------------------------------
Xamarin forms is available for business accounts, On Xamarin forms standard control can be used and it will replaced by device user control, Xamarin forms dont have UI designer currently.
PCL = Portable class library as a share library in Xamarin project
Yumtoso is an example of Xamarin project which is online ( A universal App)
http://winstoredev.com/yumtoso-fastfood-app/
Xamarin generate pure Objective C code
NO IL-code
.Net runtime
Genymotion is an android simulator on MAC os
Mobile web app ui design
http://www.telerik.com/kendo-ui1
Apache Cordova is a set of device APIs that allow a mobile app developer to access native device function such as the camera or accelerometer from JavaScript. Combined with a UI framework such as jQuery Mobile or Dojo Mobile or Sencha Touch, this allows a smartphone app to be developed with just HTML, CSS, and JavaScript.
Bower.io is a package manager for web
ionic
npmjs package installer
http://www.visualstudio.com/en-us/explore/cordova-vs.aspx
Cross platform application
Tools for Apache Cordova Update: iOS Debugging & Windows 8.1 Support
Video Presentation
--------------------------------------------------------------------------------
asp.net Next version
http://www.asp.net/vnext
http://www.asp.net/vnext/overview/aspnet-vnext/vc
http://www.asp.net/vnext/overview/aspnet-vnext/aspnet-5-overview
http://msdn.microsoft.com/en-us/library/dn481095.aspx
Announcing ASP.NET features in Visual Studio 2015 Preview and VS2013 Update 4
Release management for visual studio 2013
----------------------------------------------------------------------
Some related video can be found on Channel 9 http://channel9.msdn.com/Events/TechEd/Europe/2014
News about .Net Open source
2
Posted on 5:46 AM by Softminer and filed under
C#,
Visual Studio
Task[] tasks = new Task[1000]; for (int i = 0; i < 1000; i++) { tasks[i] = Task.Factory.StartNew(() => { Console.WriteLine(System.DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss.fff tt")); }); } Task.WaitAll(tasks);
0
From Control panel -> Turn windows features on or off its possible to install windows Message Queuing
http://technet.microsoft.com/en-us/library/cc730960.aspx
To Send and recieve message using c# first you have to create a message queue:
http://www.codeproject.com/Articles/5830/Using-MSMQ-from-C
if(MessageQueue.Exists(@".\Private$\MyQueue"))
//creates an instance MessageQueue, which points
//to the already existing MyQueue
mq = new System.Messaging.MessageQueue(@".\Private$\MyQueue");
else
//creates a new private queue called MyQueue
mq = MessageQueue.Create(@".\Private$\MyQueue");
To Send message
System.Messaging.Message mm = new System.Messaging.Message();
mm.Body = txtMsg.Text;
mm.Label = "Msg" + j.ToString();
mq.Send(mm);
and to recieve message
try
{
mes = mq.Receive(new TimeSpan(0, 0, 3));
mes.Formatter = new XmlMessageFormatter(
new String[] {"System.String,mscorlib"});
m = mes.Body.ToString();
}
catch
{
m = "No Message";
}
MsgBox.Items.Add(m.ToString())
to See messages in windows open Computer Management and from Service applications -> Message Queuing
From Control panel -> Turn windows features on or off its possible to install windows Message Queuing
http://technet.microsoft.com/en-us/library/cc730960.aspx
To Send and recieve message using c# first you have to create a message queue:
http://www.codeproject.com/Articles/5830/Using-MSMQ-from-C
if(MessageQueue.Exists(@".\Private$\MyQueue"))
//creates an instance MessageQueue, which points
//to the already existing MyQueue
mq = new System.Messaging.MessageQueue(@".\Private$\MyQueue");
else
//creates a new private queue called MyQueue
mq = MessageQueue.Create(@".\Private$\MyQueue");
To Send message
System.Messaging.Message mm = new System.Messaging.Message();
mm.Body = txtMsg.Text;
mm.Label = "Msg" + j.ToString();
mq.Send(mm);
and to recieve message
try
{
mes = mq.Receive(new TimeSpan(0, 0, 3));
mes.Formatter = new XmlMessageFormatter(
new String[] {"System.String,mscorlib"});
m = mes.Body.ToString();
}
catch
{
m = "No Message";
}
MsgBox.Items.Add(m.ToString())
to See messages in windows open Computer Management and from Service applications -> Message Queuing

0
Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.
Posted on 3:29 AM by Softminer and filed under
C#,
Visual Studio
Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.
// Factory Method pattern -- Structural example using System; namespace DoFactory.GangOfFour.Factory.Structural { /// <summary> /// MainApp startup class for Structural /// Factory Method Design Pattern. /// </summary> class MainApp { /// <summary> /// Entry point into console application. /// </summary> static void Main() { // An array of creators Creator[] creators = new Creator[2]; creators[0] = new ConcreteCreatorA(); creators[1] = new ConcreteCreatorB(); // Iterate over creators and create products foreach (Creator creator in creators) { Product product = creator.FactoryMethod(); Console.WriteLine("Created {0}", product.GetType().Name); } // Wait for user Console.ReadKey(); } } /// <summary> /// The 'Product' abstract class /// </summary> abstract class Product { } /// <summary> /// A 'ConcreteProduct' class /// </summary> class ConcreteProductA : Product { } /// <summary> /// A 'ConcreteProduct' class /// </summary> class ConcreteProductB : Product { } /// <summary> /// The 'Creator' abstract class /// </summary> abstract class Creator { public abstract Product FactoryMethod(); } /// <summary> /// A 'ConcreteCreator' class /// </summary> class ConcreteCreatorA : Creator { public override Product FactoryMethod() { return new ConcreteProductA(); } } /// <summary> /// A 'ConcreteCreator' class /// </summary> class ConcreteCreatorB : Creator { public override Product FactoryMethod() { return new ConcreteProductB(); } } }
2
Posted on 2:12 AM by Softminer and filed under
C#,
Visual Studio
using System; using System.Threading.Tasks; namespace Listing_02 { class Listing_02 { static void Main(string[] args) { // use an Action delegate and a named method Task task1 = new Task(new Action(printMessage)); // use a anonymous delegate Task task2 = new Task(delegate { printMessage(); }); // use a lambda expression and a named method Task task3 = new Task(() => printMessage()); // use a lambda expression and an anonymous method Task task4 = new Task(() => { printMessage(); }); task1.Start(); task2.Start(); task3.Start(); task4.Start(); // wait for input before exiting Console.WriteLine("Main method complete. Press enter to finish."); Console.ReadLine(); } static void printMessage() { Console.WriteLine("Hello World"); } } }
0
Posted on 7:33 AM by Softminer and filed under
C#,
Visual Studio
class Program { static BackgroundWorker _bw = new BackgroundWorker(); static void Main() { _bw.DoWork += TODO; _bw.RunWorkerAsync("Message to worker"); Console.ReadLine(); } void TODO(object sender, DoWorkEventArgs e) { // This is called on the worker thread // writes "Message to worker" Console.WriteLine (e.Argument); _backgroundworker.CancelAsync(); // Perform time-consuming task... } }
0
Passing Data in an ASP.NET MVC Application
ASP.NET State Management Overview
How we do MVC – View models
Localization for ASP.NET MVC
How to encrypt Query string in MVC +,+, +
MVC4 Mobile features
MVC View Model Pattern
Architecture Guide: ASP.NET MVC Framework + N-tier + Entity Framework and Many More
Validating with Service Layer C#
Posted on 7:55 AM by Softminer and filed under
MVC,
Visual Studio
Passing Data in an ASP.NET MVC Application
ASP.NET State Management Overview
How we do MVC – View models
Localization for ASP.NET MVC
How to encrypt Query string in MVC +,+, +
MVC4 Mobile features
MVC View Model Pattern
Architecture Guide: ASP.NET MVC Framework + N-tier + Entity Framework and Many More
Validating with Service Layer C#
0
Click on the project and choose properties , then on the Build Events run following command on Post-Build event command line:
copy /y "c:\Project\bin\Project.dll" "C:\inetpub\wwwroot\bin\"
PS: you have to run visual studio as administrator to have copy privilege.
Posted on 6:23 AM by Softminer and filed under
Visual Studio
Click on the project and choose properties , then on the Build Events run following command on Post-Build event command line:
copy /y "c:\Project\bin\Project.dll" "C:\inetpub\wwwroot\bin\"
PS: you have to run visual studio as administrator to have copy privilege.
0
Here are some usefull videos to show Building VS projects with Build and View Build Definition and writing Custom tasks.
Understanding Team Foundation Build Configuration Files
Posted on 8:54 AM by Softminer and filed under
Visual Studio
Here are some usefull videos to show Building VS projects with Build and View Build Definition and writing Custom tasks.
Understanding Team Foundation Build Configuration Files
0
Create Your Own Test Certificate and add it to your solution (key certificate)
http://msdn.microsoft.com/en-us/library/ff699202.aspx
How to run application in startup in registry
Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
key.SetValue("sysadmin", Application.ExecutablePath.ToString());
Get Current Directory of running application
System.Reflection.Assembly.GetExecutingAssembly().Location;
Posted on 7:02 AM by Softminer and filed under
C#,
Visual Studio
Create Your Own Test Certificate and add it to your solution (key certificate)
http://msdn.microsoft.com/en-us/library/ff699202.aspx
How to run application in startup in registry
Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
key.SetValue("sysadmin", Application.ExecutablePath.ToString());
Get Current Directory of running application
System.Reflection.Assembly.GetExecutingAssembly().Location;
0
IntelliTrace
Debugging with IntelliTrace, available in Microsoft Visual Studio 2010 Ultimate, provides an enhanced picture of your application compared with traditional debuggers. read more
Debugger Canvas
Debugger Canvas is a new user experience for the debugger in Visual Studio Ultimate. It pulls together the code you’re exploring onto a single pan-and-zoom display. read more
PS:Please consider that both features are part of Ultimate version of VS 2011
Posted on 8:29 AM by Softminer and filed under
Visual Studio
IntelliTrace
Debugging with IntelliTrace, available in Microsoft Visual Studio 2010 Ultimate, provides an enhanced picture of your application compared with traditional debuggers. read more
Debugger Canvas
Debugger Canvas is a new user experience for the debugger in Visual Studio Ultimate. It pulls together the code you’re exploring onto a single pan-and-zoom display. read more
PS:Please consider that both features are part of Ultimate version of VS 2011
0
NuGet is a free, open source developer focused package management system for the .NET platform intent on simplifying the process of incorporating third party libraries into a .NET application during development.
you can download it from http://nuget.codeplex.com/
and here is short video to show how to get the latest packet of some libraries.
Posted on 8:18 AM by Softminer and filed under
Visual Studio
NuGet is a free, open source developer focused package management system for the .NET platform intent on simplifying the process of incorporating third party libraries into a .NET application during development.
you can download it from http://nuget.codeplex.com/
and here is short video to show how to get the latest packet of some libraries.
0
Productivity Power Tools is a Visual studio Extension which help you coding easier.
you can get the extension from here
http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef/
you can read about it from scottgu's blog or here
and there are some video introducing features in visual studio 2010.
Part 1
Part 2
Posted on 6:39 AM by Softminer and filed under
Visual Studio
Productivity Power Tools is a Visual studio Extension which help you coding easier.
you can get the extension from here
http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef/
you can read about it from scottgu's blog or here
and there are some video introducing features in visual studio 2010.
Part 1
Part 2
0
I was trying to record some web test via Internet explorer 8 and the problem was that the plugin is not loaded. the problem was that "Microsoft Web Test Recorder Helper" was disable.
so to fix this , go to TOOLS -> Manage Add-ons and Enable the "Microsoft Web Test Recorder Helper" and try to restart IE.
for more infomation you can visit
Diagnosing and fixing Web Test recorder bar issues.
Posted on 1:44 AM by Softminer and filed under
Visual Studio
I was trying to record some web test via Internet explorer 8 and the problem was that the plugin is not loaded. the problem was that "Microsoft Web Test Recorder Helper" was disable.
so to fix this , go to TOOLS -> Manage Add-ons and Enable the "Microsoft Web Test Recorder Helper" and try to restart IE.
for more infomation you can visit
Diagnosing and fixing Web Test recorder bar issues.
1
XAML browser applications (XBAPs) combines features of both Web applications and rich-client applications. Like Web applications, XBAPs can be deployed to a Web server and started from Internet Explorer or Firefox.
Create an HTML page that contains a hyperlink to open the deployment manifest, which is the file that has the .xbap extension.
In Visual Studio, open the project properties.
On the Security tab, click Advanced.
The Advanced Security Settings dialog box appears.
Make sure that the Grant the application access to its site of origin check box is checked and then click OK.
On the Debug tab, select the Start browser with URL option and specify the URL for the HTML page that contains the XBAP.
In Internet Explorer, click the Tools button and then select Internet Options.
The Internet Options dialog box appears.
Click the Advanced tab.
In the Settings list under Security, check the Allow active content to run in files on My Computer check box.
Click OK.
Posted on 6:56 AM by Softminer and filed under
Visual Studio,
WPF
XAML browser applications (XBAPs) combines features of both Web applications and rich-client applications. Like Web applications, XBAPs can be deployed to a Web server and started from Internet Explorer or Firefox.
Create an HTML page that contains a hyperlink to open the deployment manifest, which is the file that has the .xbap extension.
<html> <head></head> <body> <a href="WpfBrowserApplication1.xbap">Click this link to launch the application</a> </body> </html>
In Visual Studio, open the project properties.
On the Security tab, click Advanced.
The Advanced Security Settings dialog box appears.
Make sure that the Grant the application access to its site of origin check box is checked and then click OK.
On the Debug tab, select the Start browser with URL option and specify the URL for the HTML page that contains the XBAP.
In Internet Explorer, click the Tools button and then select Internet Options.
The Internet Options dialog box appears.
Click the Advanced tab.
In the Settings list under Security, check the Allow active content to run in files on My Computer check box.
Click OK.
0
Posted on 2:33 AM by Softminer and filed under
C#,
Visual Studio
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime; using System.Runtime.CompilerServices; using System.Security; using System.Text; public class MainClass { public static void Main() { Thread paramThread = new Thread(ParameterizedFunction); paramThread.Start("Test"); paramThread.Join(); } private static void ParameterizedFunction(string o) { Console.WriteLine("Param worker: {0}", o); } }
0
Sometimes you need to do two different task and you want that the task do simultaneously or one task wait for other task to finish.
in the following example , there are three different Thread and when you join the Thread they will wait until all joined thread finished.
for more information you can check here
Posted on 8:13 AM by Softminer and filed under
C#,
Visual Studio
Sometimes you need to do two different task and you want that the task do simultaneously or one task wait for other task to finish.
in the following example , there are three different Thread and when you join the Thread they will wait until all joined thread finished.
using System; using System.Threading; class MyThread { public int count; public Thread thrd; public MyThread(string name) { count = 0; thrd = new Thread(this.run); thrd.Name = name; thrd.Start(); } void run() { Console.WriteLine(thrd.Name + " starting."); do { Thread.Sleep(500); Console.WriteLine("In " + thrd.Name + ", count is " + count); count++; } while (count < 10); Console.WriteLine(thrd.Name + " terminating."); } } class MainClass { public static void Main() { Console.WriteLine("Main thread starting."); MyThread mt1 = new MyThread("Child #1"); MyThread mt2 = new MyThread("Child #2"); MyThread mt3 = new MyThread("Child #3"); mt1.thrd.Join(); Console.WriteLine("Child #1 joined."); mt2.thrd.Join(); Console.WriteLine("Child #2 joined."); mt3.thrd.Join(); Console.WriteLine("Child #3 joined."); ThreadStart mythred = new ThreadStart(test); Thread t = new Thread(mythred); t.Start(); t.Join(); Console.WriteLine("Main thread ending."); } private static void test() { Thread.Sleep(3000); Console.WriteLine("My thread finished"); } }
for more information you can check here
0
On Server side:
the most important is that the compiled version should be in "Debug" mode because the released version doesnt have the debugging information.
you have to install the "Visual Studio 2008 Service Pack 1 Remote Debugger".
you can download "Visual Studio 2008 Service Pack 1 Remote Debugger" from here
once you have installed it, run the service with "Local Account" authentication. and then run the debugger "rdbgwiz.exe" and allow the users on the domian to connect to the debugger remotly.
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\rdbgwiz.exe
afterward run "MSVSSMON.EXE" as Administrator. otherwise you can not debug "w3wp.exe"
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86\msvsmon.exe
On Developer side:
To attach to a running ASP.NET application, you have to know the name of the ASP.NET process:
If you are running IIS 6.0 or IIS 7.0, the name is w3wp.exe.
If you are running an earlier version of IIS, the name is aspnet_wp.exe.
For applications built by using Visual Studio 2005 or later versions, the ASP.NET code can reside on the file system and run under the test server WebDev.WebServer.exe. In that case, you must attach to WebDev.WebServer.exe instead of the ASP.NET process. This scenario applies only to local debugging.
Posted on 6:59 AM by Softminer and filed under
ASP.NET,
Visual Studio
On Server side:
the most important is that the compiled version should be in "Debug" mode because the released version doesnt have the debugging information.
you have to install the "Visual Studio 2008 Service Pack 1 Remote Debugger".
you can download "Visual Studio 2008 Service Pack 1 Remote Debugger" from here
once you have installed it, run the service with "Local Account" authentication. and then run the debugger "rdbgwiz.exe" and allow the users on the domian to connect to the debugger remotly.
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\rdbgwiz.exe
afterward run "MSVSSMON.EXE" as Administrator. otherwise you can not debug "w3wp.exe"
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86\msvsmon.exe
On Developer side:
On Developer side where visual studio is intalled you need to open web Solution with visual studio 2008 and go to Menu debug and attach to debugger and then giving pc name and then connect to w3w.exe
You have to open the project otherwise the debug menu will not show up.
To attach to a running ASP.NET application, you have to know the name of the ASP.NET process:
If you are running IIS 6.0 or IIS 7.0, the name is w3wp.exe.
If you are running an earlier version of IIS, the name is aspnet_wp.exe.
For applications built by using Visual Studio 2005 or later versions, the ASP.NET code can reside on the file system and run under the test server WebDev.WebServer.exe. In that case, you must attach to WebDev.WebServer.exe instead of the ASP.NET process. This scenario applies only to local debugging.
0
Obfuscated code is source or machine code that has been made difficult to understand.
in other words its a way to encode the source code that would not be easy to decode. there is a famous free tool called .NET reflector which give the possibility to open compiled DLL or even EXE files of .NET project and see the source code.
to avoid this we have to obfuscate the source code.
Eazfuscator.NET
Eazfuscator.NET is a free obfuscator for .NET platform. The main purpose of obfuscator is to protect intellectual property of the software.
Skater .NET obfuscator
Skater .NET obfuscator is designed for both (x86 and x64) operating system platforms.
.NET Reactor
.NET Reactor is a powerful .NET code protection & licensing system which assists developers in protecting their .NET software.
for more discussion visit here
Obfuscated code is source or machine code that has been made difficult to understand.
in other words its a way to encode the source code that would not be easy to decode. there is a famous free tool called .NET reflector which give the possibility to open compiled DLL or even EXE files of .NET project and see the source code.
to avoid this we have to obfuscate the source code.
Eazfuscator.NET
Eazfuscator.NET is a free obfuscator for .NET platform. The main purpose of obfuscator is to protect intellectual property of the software.
Skater .NET obfuscator
Skater .NET obfuscator is designed for both (x86 and x64) operating system platforms.
.NET Reactor
.NET Reactor is a powerful .NET code protection & licensing system which assists developers in protecting their .NET software.
for more discussion visit here
0
There are many source control software that can be used depend on the purpose for example :
Tortoise SVN
Source Gear (Vault)
fo visual studio
Microsoft Source Safe
Team Foundation Server
Source Safe can be used for small project because in source safe one user can just check out the source and the file is locked, but in TFS in can be edited by many users and then users can solve the conflict when they check-in.
Top features of TFS are :
Part 1
Part 2
Part 3
Part 4
There are many source control software that can be used depend on the purpose for example :
Tortoise SVN
Source Gear (Vault)
fo visual studio
Microsoft Source Safe
Team Foundation Server
Source Safe can be used for small project because in source safe one user can just check out the source and the file is locked, but in TFS in can be edited by many users and then users can solve the conflict when they check-in.
Top features of TFS are :
- Project Management (connecting to Agile)
- Reporting (Based on .NET Framework)
- Automated Builds
- Process Templates
- Code Branching
- Web-Based Portal (Sharepoint)
- Source Control
Part 1
Part 2
Part 3
Part 4