Quantcast
Channel: Visual Studio Integrate forum
Viewing all 4410 articles
Browse latest View live

Create project item with the attribute in the project file.

$
0
0

I can easily create a project with an item having the attribute <LogicalName></LogicalName> in the projectTemplate project file by using

   <EmbeddedResource Include="some.xml">
      <SubType>Designer</SubType>
      <LogicalName>LogicalName.xml</LogicalName>
    </EmbeddedResource>

However, if I am creating a project item, there is of course no projectTemplate project file. How do I create a project vsix project item, lets say in CSharp or VisualBasic, that will create the LogicalName attribute for the item? Do I need a wizard to modify the project file? If so please give direction and approach to modifying the project file. Preferably with automatic reloading of project file if possible (without prompt from user). 

Note: vstemplate file only has the following attributes for a project item

<ProjectItem
    SubType="Form/Component/CustomControl/UserControl"
    CustomTool="string"
    ItemType="string"
    ReplaceParameters="true/false"
    TargetFileName="TargetFileName.ext">
        FileName.ext
</ProjectItem>

No LogicalName

If this is not clear, I will attempt to rephrase question.


Visual Studio Package: Expand/Collpase State of Items

$
0
0

Hi there,

I want to manipulate the expand/collapse state of TreeView items in the solution explorer in my package.

I want to save the current state, do some stuff with the projects and items (for example delete and readd) and then set the previous expand/collapse state so that the states are as they were before my manipulation.

Is there an easy way to do this? I think I need another way of doing this as I did before to get project and item data.

Thx,
Fabian


The Visual Studio Settings-Switcher! Visit http://visualstudiogallery.msdn.microsoft.com/a79072f7-3109-44a0-95c0-9c50e729d6a3

How do I automate attaching the debugger to a remote process?

$
0
0

I have remote debugging set up and can debug from my host machine (Windows 7, 64-bit, UAC Enabled, with Visual Studio running as Administrator) to my guest machine with no problems at all(Windows 7, 32-bit, Remote Debugger running as a service). Connecting manually using the menu "Attach Process", entering the remote machine and specifying the process works fine.

I want to automate attaching to a remote process using the debugger but I cannot automate it using the code generated by the in-built macro recorder:

Try
Dim dbg2As EnvDTE80.Debugger2 = DTE.Debugger
Dim transAs EnvDTE80.Transport = dbg2.Transports.Item("Default")
Dim dbgeng(2)As EnvDTE80.Engine
d
bgeng(0) = trans.Engines.Item("Managed (v4.0)")
dbgeng(1) = trans.Engines.Item("Native")

Dim proc2As EnvDTE80.Process2 = dbg2.GetProcesses(trans,"TheMachineName").Item("myremoteprocessname.exe")

proc2.Attach2(dbgeng)     

Catch exAs System.Exception

            MsgBox(ex.Message)

EndTry

I get the error:

"The Microsoft Visual Studio Remote Debugging Monitor (MSVSMON.EXE) does not appear to be running on the remote computer. Please see Help for assistance".

However, it definitely IS running because I can attach manually. I suspect the problem is with the machine name which is really a qualiifier - can I please ask what qualifier do I need to use when I want to attach to the remote debugger that is running as a service?

Cheers!

Grey Ham

PS: I realize I can set up F5 to do this, but I would prefer to use the extensibility API's...


Blog: http://www.havecomputerwillcode.com/blog

VSIX development error VSSDK1040: There was a problem enabling the extension with a VSIX identifier of ....

$
0
0

I am developing a VSIX project in VS2013. My current project is a little bit detailed but today I realized that error happens even on a new project.

To find out reason of the problem, I have created a very simple VSIX extension. I just opened new project window and selected Extensibility and then VSIX. After project creation I built project and received this error:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\VSSDK\Microsoft.VsSDK.targets(503,5): error VSSDK1040: There was a problem enabling the extension with a VSIX identifier of "0.0.1". The input source is not correctly formatted.




Access violation exiting an Isolated Shell application

$
0
0

My Isolated Shell app is now suddenly giving this crash on exit that I have no idea of where it comes from.

Here are the details Windows give:

  Problem Event Name:APPCRASH

  Application Name:<omitted>.exe

  Application Version:1.0.0.1

  Application Timestamp:541c3849

  Fault Module Name:msenv.dll

  Fault Module Version:12.0.30723.0

  Fault Module Timestamp:53cf6f1e

  Exception Code:c0000005

  Exception Offset:0001e974

  OS Version:6.1.7601.2.1.0.256.4

  Locale ID:1033

  Additional Information 1:0a9e

  Additional Information 2:0a9e372d3b4ad19135b953a78882e789

  Additional Information 3:0a9e

  Additional Information 4:0a9e372d3b4ad19135b953a78882e789

When I debug this isolated shell from VS, the same access violation occurs, and the file crtexe.c opens up. Again, not even close to any part of my code.

The only thing I did recently was installing the VS 2013 Update 3, since I had to install the Azure SDK and it forced me to update VS.

So now I am running VS 2013 Pro v12.0.30723.00 Update 3. My Isolated Shell app consists of a few VSPackages deriving from the Managed Project Framework. I am developing it for a full year now, and never had this kind of problem before.

Another, perhaps related, question is if Microsoft will ever release updates the VS 2013 Isolated Shell redistributable like its doing with VS 2013. I dont know if this can be a problem, but my appenvstub.dll is still on version 12.0.21005.1.

EDIT 1: Even creating a new Isolated Shell from scratch gives the same result. It always crash on exit. Next thing on my list is running a repair/reinstall of Visual Studio and all of its updates, which will consume at least half of my day :(

How to subscribe Add Existing Item event for a VS project

$
0
0

Hi,

In our package, we want to handle this scenario - use Add Existing Item dialog to add a file to a project (the project already has a file with same file name). VS will popup below dialog,

Could you tell me how we can subscribe to the event when user click Yes button in above dialog?

Can we install 2012 update 4 in 2013 installed machine ?

$
0
0

Hi Everyone,

Can we install VS 2012 update 4 in a VS2013 installed machine ?

Could you please provide suggestion on this ? If we install like this did we face any issue ?

Regards,

Manoj Babu B. 


Manoj

Upgrade a VS2010 Isolated shell to VS2013 shell

$
0
0

I am upgrading a VS2010 Isolated Shell application to VS2013 shell. I am getting following errors in the active logs.

1.What does the first error mean? how to fix it?

2. For second error, I saw multiple similar errors associate with different GUID.I searched 4CA58AB2-18FA-4F8D-95D4-32DDF27D184C in registry table, looks like every time when I launch my application, it will overwrite the path of this GUID to pathWhereILaunchApplication\Common7\IDE\PrivateAssemblies*\Microsoft.VisualStudio.TeamFoundation.VersionControlUI.dll, not the Visual Studio installation path, which leads to cannot locate the dll error.

Can someone help me out of here?

 <entry>
    <record>20</record>
    <time>2014/10/03 18:52:41.650</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>Loading UI library</description>
    <guid>{8889E051-B7F9-4781-BB33-2A36A9BDB3A5}</guid>
    <hr>800a006f</hr>
    <errorinfo>Class not registered.
Looking for object with CLSID: {6C4024E7-5DEC-4EEC-B3F9-55B3F3AD1E9E}.</errorinfo>
  </entry>
  <entry>
    <record>21</record>
    <time>2014/10/03 18:52:42.044</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>Loading UI library</description>
    <guid>{4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}</guid>
    <hr>80004005 - E_FAIL</hr>
    <errorinfo>Cannot find the requested resource.</errorinfo>
    <path>D:\branchDir\bin\x86\Debug\ManagementStudio\Common7\IDE\PrivateAssemblies*\Microsoft.VisualStudio.TeamFoundation.VersionControlUI.dll</path>
  </entry>

Visual Studio Integrate REST Api - WIQL request returns status 400 (Bad Request)

$
0
0

Hi,

I'm attempting to submit a WIQL (Work Item Query Language) request to the Visual Studio Online REST api but receiving a status code 400 (Bad Request).

I'm using the sample request of the first example "Run a query" of the reference documentation listed here: http://www.visualstudio.com/en-us/integrate/reference/reference-vso-work-item-wiql-vsi

I've taken the sample request: https://fabrikam.visualstudio.com/DefaultCollection/Fabrikam-Fiber-Git/_apis/wit/wiql?api-version=1.0-preview.2 and substituted "fabrikam" with our account and "Fabrikam-Fiber-Git" with our team project name.

I've used the exact same query listed for the sample request:

{
  "query": "Select [System.WorkItemType],[System.Title],[System.State],[Microsoft.VSTS.Scheduling.Effort],[System.IterationPath] FROM WorkItemLinks WHERE Source.[System.WorkItemType] IN GROUP 'Microsoft.RequirementCategory' AND Target.[System.WorkItemType] IN GROUP 'Microsoft.RequirementCategory' AND Target.[System.State] IN ('New','Approved','Committed') AND [System.Links.LinkType] = 'System.LinkTypes.Hierarchy-Forward' ORDER BY [Microsoft.VSTS.Common.BacklogPriority] ASC,[System.Id] ASC MODE (Recursive, ReturnMatchingChildren)"
}

Couple of things that I've tried:

1. I've tried both "api-version=1.0-preview.2" and "api-version=1.0-preview.1"

2. I've left out the project name from the request url: Based on the query format listed in the example "https://{account}.visualstudio.com/defaultcollection/[{project}/]_apis/wit/wiql?api-version={version}" I'm assuming that the wrapping of the project section in the url in square brackets ([{project}/]) indicates that this section is optional.

3. I've tried a simpler query:

{
 "query": "Select [System.WorkItemType],[System.Title],[System.State],[Microsoft.VSTS.Scheduling.Effort],[System.IterationPath], [Microsoft.VSTS.Common.BacklogPriority] From WorkItems"
}

Any help would be greatly appreciated.

Kind Regards,

Morné


Access ISharePointProjectService from T4 Text Template

$
0
0

I have a Visual Studio 2013 SharePoint solution/project in which I set the "Site URL" to which I want to deploy the project (standard functionality). I would like to consume the project's "Site URL" property in a T4 Text Template.  However, it appears that this may not be possible because T4 is (apparently) not running as a Visual Studio add-in.  (Seehttp://msdn.microsoft.com/en-us/library/ee471432.aspx.)

In other words, I want to do something like this in a T4 (.tt) file (rookie code):

<# IServiceProvider serviceProvider = (IServiceProvider)this.Host;
   EnvDTE.DTE dte = (EnvDTE.DTE) serviceProvider.GetService(typeof(EnvDTE.DTE));
   EnvDTE80.DTE2 dte2 = (DTE2)dte;
   ServiceProvider serviceProvider2 = new Microsoft.VisualStudio.Shell.ServiceProvider(dte2 as Microsoft.VisualStudio.OLE.Interop.IServiceProvider);
   Microsoft.VisualStudio.SharePoint.ISharePointProjectService projectService = serviceProvider2.GetService(typeof(Microsoft.VisualStudio.SharePoint.ISharePointProjectService)) as Microsoft.VisualStudio.SharePoint.ISharePointProjectService;

When I run this example, the projectService comes back as null.  (The other code returns valid objects.)

Does anyone know if this is possible and, if so, how to do it?

Thanks!  John

REST API : Query on Work Item giving error "You cannot supply a time with the date when running a query using date precision"

$
0
0
while executing following query using rest api getting error

Error Message: You cannot supply a time with the date when running a query using date precision

URL: https://[Account].visualstudio.com/DefaultCollection/_apis/wit/wiql?api-version=1.0-preview.2

Body:

{

  "query": "SELECT [System.Id] FROM WorkItems
                 WHERE [System.WorkItemType] = 'Bug'
                 and  [System.TeamProject] in ('Project1')
                 and ((([System.ChangedDate] > '2014-10-07 18:30:00.000')) and ([System.CreatedDate] <= '2014-10-08 18:30:00.000'))"
}


I want to consider Time precision as well with date, and even when we are fetching work item information using rest api call in that case system.changedate is actually datetime field.

so why its not allowing in query.

Is there any way such that query consider datetime precision for these fields.

Please Reply ASAP




Getting the type of a template parameter

$
0
0

Using VCCodeClass::TemplateParameters I want to retrieve the type of the template parameter.
Here is the the template class:

template <class T>
class t
{
    t( void );
    void f( void );
};

In C# I cast the elements of the TemplateParameters collection to VCCodeParameter and then use either TypeString or FullName. Both always return only "T".
How can I get either "class T" or "class"? Or in case of this: <int C>, "int C" or "int"?

I am using VS Professional 2013
Version 12.030723.00 Update 3

Thank You!

How to dispose vspackage object when package Tab closed?

$
0
0

Hello, 

I am developing a vspackage to connect to our custom database. When initially load the package, my MainWindow.xaml is initializing. But, when I close & re-open the package (only pakcage tab, not visual studio), My mainwindow.xaml is not initializing. Its retaining the objects.

I want to dispose everything when package tabpage window closed not when restart visual studio. How can i do this? I tried to override 'OnClose()' method in myToolWindow.cs, but no luck. 

Any help would greatly appreciated and saves alot of time. Thanks :)

Is possible to set "Enable Restore package" by default in a VSTemplate?

$
0
0

I am trying to create VSTemplate from a sample, but I need to have "Enable Restore package" defined by default... 

I did some search but not found a solution.... is not possible?

The vstemplate created  can be found here

https://www.dropbox.com/s/xdcnlsajhljivk6/AppStudio.Menu.BackEnd.zip?dl=0

After install all reference has a warning and after I "Enable Restore package" and compile the project looks ok.

Note: all packages are added in VSTemplate...


Sara Silva - Microsoft Visual C# MVP
My blog | My Windows 8 Store Apps Samples | More Samples
Follow me in Twitter @saramgsilva

My Windows 8 Store Apps: Female Pill | Galinho (Tic tac Toe) | 24 | My Snake
My Windows Phone Apps

How to Write code for EMoney.Transactions (Nuget) using C# EMoney

$
0
0

I installed EMoney.Transactions NuGet tools using PM> and I got EMoney.Transactions namespace of ETS API library

I want code sample for Pre-authentication, post-authentication, sales and billing kindly help me



Import database. Could not connect to the database to retrieve the configuration

$
0
0

I'm using VS Ultimate 2013 Update 2, SQL server 2014. I created a database project and tried to import an existing database. I got this error message popped up: Import Database Could not connect to the database to retrieve the configuration.

Test Connection was successful. In fact the same username/password, which has db owner permission, was used to connect to the same database in Server Explorer.

Is there any settings that I missed?

How to expand/collapse a hierarchy node in the solution explorer?

$
0
0
I created my own project type by extending PorjectNode. When I create folders and files in the project at runtime, I'd like to keep the folders collapsed.

I tried to set the "isExpanded" to false on a hierarchy node, but it doesn't seem to make any diffence.

Can anyone help?
Thanks,
Jillaint.


VSPackage Deployment: Custom Installer with VS Gallery Auto Updates

$
0
0

I have a VSPackage with a custom editor. I want it to show up in the solution explorer with a custom icon, which will require a custom deployment step.

Here are my deployment requirements:

  • As explained here, allow users to easily update to new versions of my extension using the Visual Studio Gallery (In VS Tools > "Extensions and Updates" > Updates).
  • As explaned here, I need to run a custom installation step to set up the custom icon in the registry (outside the VS registry hive, which means PKGDEF files can't do it).

As explained here and here, instead of using a VSIX file, I could create a custom installer that places the extension files directly in the user/machine-wide extension folder on the target machine.

Problem is I think the easy extension update process from the VS Gallery would not work. Can I get both of the requirements above? If so, how?

As a workaround, could I check if the icon is set up correctly in the package Initialize method, and if not, run some custom code to set up the registry settings?  In this case I can stick with VSIX deployment and the auto-updates work.

Alternatively, if I create a custom installer that deals with updates and copies new versions of the extension files to the extension folder, how do I register it so that VS "Extensions and Updates" checks the VS Gallery version number for updates?

how to collapse a file in solution explorer after adding it dynamically to the project.

$
0
0

Hi, 

         I need to collapse the folder in solution explorer when project is created.the file is added to the project dynamically,

I have heard about  EXPF_collapse folder, but i dint know how to use it,can anyone please provide me solution on this.


Kani


How to substitute macros

$
0
0
In the Microsoft.VisualStudio.VCProjectEngine namespace there are certain methods that return strings that have $(NAME) macros.  Is there some way to substitute these macros so that a macro free string is produced?  In particular I am using Microsoft.VisualStudio.VCProjectEngine.VCConfiguration.OutputDirectory.
Viewing all 4410 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>