I'm workng to get include path resolved by some VS plugin (asm-dude in fact). Include path in microsoft macro assembler looks like this:
includepath
Include file resolve part in asm-dude lies in: https://github.com/HJLebbink/asm-dude/blob/vxix2022-B/VS/CSHARP/asm-dude-vsix/Tools/LabelGraph.cs#L602
Anyway, at the beginning I think I just need to get the value of IncludePath property, and then other things can be done in a minute. But after reading some docs I realized I'm in a mess. It seems that VS prevents me to get names of all properties, but I can only get the value by the name.
Codes I write are like:
DTE dte = Package.GetGlobalService(typeof(SDTE)) as DTE;
Projects projects = dte.Solution.Projects;
if (projects.Count != 0)
{
VCProject project = (VCProject)projects.Item(1).Object;
VCConfiguration cfg = project.ActiveConfiguration;
if (cfg != null)
{
string includePathStr = cfg.GetEvaluatedPropertyValue("IncludePaths");
}
}
but in vein, it gets include path of msvc, not MASM
I cast Project to VCProject because it's a VC project. Although I can iterate properties of a non-VCProject's configuration, but it doesn't seem to work on VCProject, because it doesn't have a (at least not public) member named properties. All these docs tell me that I can only get its value by name, but the problem is I don't know its name. Or I'm completely wrong? I must admit that I'm new to VS plugins.
refs I used so far:
https://learn.microsoft.com/en-us/previous-versions/dn655034(v=vs.140)?redirectedfrom=MSDN
https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.vcprojectengine.vcconfiguration?view=visualstudiosdk-2022
EDIT - Looks like the initial problem only applies to .NET Core projects. So the question shifts to "What is the correct way to get the full range of project properties from .NET Core projects?"
I'm writing a Visual Studio 2019 plugin that uses some of the project configuration settings. It seems straight forward enough to get the Project object (C# here, but also C++ & others) and then spelunking the Configuration's for Property objects.
But it appears that accessing most of the properties will throw System.NotImplementedException.
Primary Question: Is there another way to access these settings - like startup arguments and other debugging configuration?
Secondary Question: Are there any good resources on this stuff? The online MS docs are a bit terse for my taste.
void ProcessCSharpProject(VSProject csProj)
{
foreach (var config in csProj.Project.ConfigurationManager.Cast<Configuration>())
{
Property debugInfoProp = config.Properties.Item("DebugInfo");
var debugInfo = debugInfoProp.Value as String; // works
Property startArgsProp = config.Properties.Item("StartArguments");
var startArgs = startArgsProp.Value as String; // NotImplemented
// Another way to access the same thing:
var configProps = config.Object as CSharpProjectConfigurationProperties6;
var startArgs2 = configProps.StartArguments; // Also NotImplemented
}
}
Thanks!
I have developed a COM+ Component in C# be inheriting ServicedComponent.
Here is how it looks like:
[Transaction(TransactionOption.Required)]
[ClassInterface(ClassInterfaceType.AutoDual)]
[EventTrackingEnabledAttribute(true)]
[JustInTimeActivation]
[ObjectPooling(Enabled = true, MinPoolSize = 10, MaxPoolSize = 30, CreationTimeout = 15000)]
[Synchronization]
class MyComponent: System.EnterpriseServices.ServicedComponent
{
[AutoComplete(true)]
public string getHello()
{//2nd breakpoint
ContextUtil.SetComplete();
return "HelloWorld";
}
}
I have another test project from which I call this component.
class Program
{
static void Main(string[] args)
{
MyComponent myComp = new MyComponent();
myComp.getHello();//1st Breakpoint
}
}
I am not able to reach 2nd Breakpoint. This was working before I switched to VS 2012. Strange thing is after switching to 2012 its no longer working in VS 2010 too.
I've already tried,
Attach to process
Unchecked "Enable Just My Code" in debug settings
Can someone please give direction from here?
UPDATE 1
From the links given by Mike, I tried symchk for my DLL in the same folder where DLL and PDB files were there. It fails with error saying PDB mismatched or not found. I don't know how to resolve this error.
You may be missing the .pdb file in your project.
Check this microsoft link out for an explanation: https://msdn.microsoft.com/en-us/library/yd4f8bd1(vs.71).aspx
I'm trying to update the label/publisher field using Taglib-sharp, but I can't see it anywhere in its Object Hierarchy using Object Browser.
I've searched through google and the documentation and it looks like it's a field that's not catered for.
Before I look for alternatives (can any one suggest any?) that can edit those field, I thought I'd have one last crack and ask within the StackOverflow community who is familiar with TagLib-sharp that had a more informed opinion?
Thanks in Advance,
Francis
Update : I've investigated other libraries such as mpg123 & UltraID3Lib but they seem to have the same limitations.
Well, Daniel Fuchs answer didn't work for me. But, it was a beginning.
The step by step to add a field in the TagLib-sharp code is:
Download Source
Open the File TagLib/Tag.cs and insert the following code (I inserted it below PerformersSort, line 250):
public virtual string Publisher
{
get { return ""; }
set { }
}
Open the File TagLib/Id3v2/Tag.cs and insert the following code (I inserted it below PerformersSort, line 1292):
public override string Publisher
{
get { return GetTextAsString(FrameType.TPUB); }
set { SetTextFrame(FrameType.TPUB, value); }
}
Open the File TagLib/Id3v2/FrameTypes.cs and insert the following code (I inserted it below TPOS, line 71):
public static readonly ReadOnlyByteVector TPUB = "TPUB";
Now comes the "Aha" thing. Open the File TagLib/CombinedTag.cs and insert the following code (I inserted it below PerformersSort, line 318):
public override string Publisher
{
get
{
foreach (Tag tag in tags)
{
if (tag == null)
continue;
string value = tag.Publisher;
if (value != null)
return value;
}
return null;
}
set
{
foreach (Tag tag in tags)
if (tag != null)
tag.Publisher = value;
}
}
Finally, compile the code.
IMPORTANT: I had problems compiling the code, as well. You must download the SharpZipLib dll (.NET 2.0) and include this dll in the taglib project. Also, I needed to install NUnit, which I made with Nuget. At last, I commented the GDK lib and all its errors inside the test code, since in production it won't be used.
Well TagLib# is not able to to read the publisher tag. Even the newest version (2.1.0.0) as of now won't be able to do that. As an alternative you can add this functionality yourself using the source code of TagLib#, which is freely available.
To do so, open the file TagLib/Id3v2/FrameTypes.cs and add the following line somewhere:
public static readonly ReadOnlyByteVector TPUB = "TPUB"; // Publisher field
And in the file TagLib/Id3v2/Tag.cs:
public string Publisher {
get {return GetTextAsString (FrameType.TPUB);}
set {SetTextFrame (FrameType.TPUB, value);}
}
You can then access the Publisher field using something like this
TagLib.File tf = TagLib.File.Create(...); // open file
tf.Tag.Publisher = "Label XY"; // write new Publisher
tf.Save(); // save tags
Please note, that this is an ugly hack but will work for MP3 files.
I'm not used to TagLib#, but I'm using TagLib in a Qt project, where I retrieve this information inspecting TagLib::File::properties.
Take a look at the documentation, it is just a string map with every property and values.
Hope TagLib# has this method.
Update 2019-12-30:
It looks like the main taglib project has included the publisher field, so you should just use the latest version instead. I've updated to the latest TagLib from my fork and can attest that it works as expected.
Tip : If you want to change the framework version that TagLib compiles to (at time of writing it defaults to 462 and .NET STD 2.0), you need to change the Directory.Build.Props file located in the Solutions folder.
<Project>
<PropertyGroup>
<ReleaseVersion>2.2.0.0-beta</ReleaseVersion>
<RepositoryUrl>https://github.com/mono/taglib-sharp</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<TaglibSharpTargetFramework>net472;netstandard2.0</TaglibSharpTargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>
</Project>
I've pasted my version above which shows that I've changed it to compile to .NET 4.7.2 instead.
I am currently trying to create an addin for Visual Studio 2008 that will list all files which are not excluded from the current build configuration.
I currently have test C++ console application that has 10 files, 2 of which are "Excluded From Build". This is a property that will allow a specific file to be excluded from a specific configuration (i.e. Debug or Release). This property is located when you right click on a file in the solution explorer and select Properties->Configuration Properties->General->Excluded From Build
At the moment I have the following code that will loop though all project files and get the properties for each file.
foreach (Project theProject in _applicationObject.Solution.Projects)
{
getFiles(theProject.ProjectItems);
}
private void getFiles(ProjectItems theItems)
{
foreach (ProjectItem theItem in theItems)
{
string theItemName = theItem.Name;
foreach (Property theProp in theItem.Properties)
{
string thePropName = theProp.Name;
}
getFiles(theItem.ProjectItems);
}
}
The issue I am having is that I cant seem to find the "Excluded From Build" property. I cannot find very good documentation on what properties are listed where. Where is this Excluded From Build property located within the _applicationObject object?
I'm not familiar with the Visual Studio object model, but in the documentation for VS2005 the following objects have an ExcludedFromBuild property:
VCFileConfiguration
VCFileConfigurationProperties
VCPreBuildEventTool
VCPreLinkEventTool
VCPostBuildEventTool
VCWebDeploymentTool
Hopefully this will lead you down the right path.