Is OfficeOpenXML required or not - requirements

I am confused by the statement
"EPPlus is a .NET library that reads and writes Excel files using the Office Open XML format (xlsx). EPPlus has no dependencies other than .NET. "
then the following statement:
"The first thing you do is to create an instance to the ExcelPackage class. To do that you first need to add a using directive to OfficeOpenXml namespace in the top of your file. This is the top namespace in EPPlus;
using OfficeOpenXml;"
so, should I always import OfficeOpenXml? The datatable to spreadsheet code works fine without it...
Thanks

Those two statements aren't contradictory. EPPlus doesn't require anything other than .NET to run. And the "OfficeOpenXml" namespace is part of EPPlus.
"ExcelPackage" is a class in the "OfficeOpenXml" namespace, so you could use a "using OfficeOpenXml" or you could fully qualify it as "OfficeOpenXml.ExcelPackage".

Related

Wrong "ReflectedWorkItemIDFieldName" while migrating Azure DevOps Work Items

I am testing the azure-devops-migration-tools and have create a project using https://azuredevopsdemogenerator.azurewebsites.net/ (Parts Unlimited). I have generated the configuration.json and changed the Source and Target so I can test a migration, but I'm getting errors while migrating Work Items.
[15:14:41 ERR] Error running query
Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException: TF51005: The query references a field that does not exist. The error is caused by «ReflectedWorkItemId».
I've tried different options on the "ReflectedWorkItemIDFieldName" field, Scrum, Basic, Agile, Custom, empty but am still unable to migrate the work items.
How can I get the value to put on this field for the specific project?
Thanks,
Bruno
Quick Solution: Most ADO instances use the prefix 'custom' for new fields. Try "Custom.ReflectedWorkItemId" in your configuration.json to see if that resolves the problem.
More details: It's hard to tell without an actual configuration.JSON file to review. One possible problem is that you need to use the actual and full internal 'Name' of the ReflectedWorkItemID field. This doesn't show in ADO, or the Process Template when created. The recommendation is that you create a query referencing your custom field, and export the WIQL file (query file). Once you export the WIQL file, you can then open the file and see the full syntax of the custom field.
Exporting Queries: If you don't know how to do this, it can be done with VisualStudio. If you don't know how to do that, you can install this extension. It's a handy WIQL import/Export and editor. Install, and your ADO Queries with have an Edit in WIQL Editor option. Create a query that exposes your 'ReflectedWorkItemID' as a column, then edit that query in the WIQL editor and see the full names of the Reflected Work Items ID Feild. https://marketplace.visualstudio.com/items?itemName=ottostreifel.wiql-editor
SELECT
[System.Id],
[System.WorkItemType],
[System.Title],
[System.AssignedTo],
[System.ChangedBy],
[Custom.ReflectedWorkItemId]
FROM workitems
WHERE ...
I found a possible solution. I have created a custom process, change the process from the projects to this new one and add a new field. This is the field I'm using on the configuration.json and now I'm able to migrate work items
To make the migration in the "ReflectedWorkItemIDFieldName" you must do:
"Organization Settings" -> Process -> Select the process where you project are (Basic, Scrum, Agil, or CMMI).
then click on the 3 dots and create a new Inherited process.
Then with the inherited process, you are able to create a new field for each work item type. The name that you type (could be "IronMan") that name will be in your configuration file.

LINQPad 4 doesn't know about HttpUtililty - how to resolve?

I recently started using LINQPad to test bits and pieces and its a great time saver.
However, sometimes it gives me some errors with minor things.
when I want to test this:
HttpUtility.UrlPathEncode("Make sure");
I get this error: The name 'HttpUtility' does not exist in the current context.
Is there a way to get it to recognize basic stuff like HttpUtility?
I just tried writing:
System.Web.HttpUtility.UrlPathEncode("Make sure")
and I am shown this: The type or namespace name 'HttpUtility' does not exist in the namespace 'System.Web'
You need to a reference System.Web.dll. Press F4 (References) and add a reference to that DLL.
Or, if you have an autocompletion license, just type your original query:
HttpUtility.UrlPathEncode("Make sure");
and open the smart-tag that automatically appears. It will present a menu option to add the reference to System.Web.dll and import the System.Web namespace in a one-fell-click!

DataContext Doesn't Exist in Dynamic Data Project?

This is really annoying...and I know it is something extremely simple...
1. I create a new Dynamic Data project.
2. I add a LINQ-to-SQL class and drag and drop some tables onto the class.
3. I open the global.asax.vb and uncomment the line:
DefaultModel.RegisterContext(GetType(YourDataContext), New ContextConfiguration() With {.ScaffoldAllTables = True})
I remove YourDataContext and replace it with the DataContext from my LINQ-to-SQL class:
DefaultModel.RegisterContext(GetType(NorthwindDataContext), New ContextConfiguration() With {.ScaffoldAllTables = True})
I then try to debug/build/etc. and receive the following error:
Type 'NorthwindDataContext' is not defined
Why is it not defined? It seems like its not recognizing I created the DBML file.
This is a very strange issue and I am still not sure that I have entirely fixed the issue. But, here is what I think I have learned:
1. If you are creating a New Project in VS2010 you must place the LINQ-to-SQL DBML file in the root project directory.
2. If you are creating a new Web Site in VS2010 you must place the LINQ-to-SQL DBML file in a newly created App_Code directory.
3. If you place it in the wrong place, scrap the project and start over - it doesn't seem to work even if you move the files to the correct location or recreate them in the correct location.
Dave.
Does your project compile? I am guessing you are missing the namespace to your data context. Something like this:
model.RegisterContext(typeof(MyApp.MyNamespace.NorthwindDataContext),
new ContextConfiguration() { ScaffoldAllTables = true });

How to get exported function names from a .dll(system)?

I want the exported function namelist (by name and by ordinal) from a DLL. I got the function names(exported by name) using export directory table,but I can't retrieve the exported function list, which exported by ordinals.
Please help me to retrieve it. I also tried .lib of that dll, there is also, displays NONAME. thanks in advance to legends
If You know dll name ,You can view through many tools (pe explorer,CFF Explorer),Here all exported function names are viewable with ordinal .Another one way from microsoft (dumpbin.exe) its a command line tool ..its also list out all exported fn names
If you have mingw32 installed, simply run
nm.exe your_dll
Where your_dll is the dll you want to to get the ordinals and exports of.
nm.exe should be in the bin directory of your mingw32 installation.

IntelliSense in VB Xml literals

is there a way to enable IntelliSense for XML literals in VB9 (VS 2008)?
The ideal source of IntelliSense is an XSD document, but I can use anything else format to do it.
Thanks
http://msdn.microsoft.com/en-us/library/bb531402.aspx
It works, I used it a few months back. If you have VS2k8 Docmentation installed, go to How to: Enable XML IntelliSense in Visual Basic at ms-help://MS.MSDNQTR.v90.en/dv_vbalr/html/af67d0ee-a4a6-4abf-9c07-5a8cfe80d111.htm, it has the example you need to get this working. The on-line documentation is lacking.
How to Use LINQ to XML
How to: Enable XML IntelliSense in Visual Basic
Shows how to add an XML schema to a Visual Basic project to provide XML IntelliSense that shows possible attributes, child elements, or descendant elements for XML literals.
Excerpt
To import an XML namespace in a code file
Identify the target namespace from your XSD schema.
At the beginning of the code file, add an Imports statement for the target XML namespace, as shown in the following example.
Imports <xmlns:ns="http://someNamespace">
To import an XML namespace as the default namespace, that is, the namespace that is applied to XML elements and attributes that do not have a namespace prefix, add an Imports statement for the target default XML namespace. Do not specify a namespace prefix. Following is an example of an Imports statement.
Dim phone2 As XElement = <phone type="home">206-555-0144</phone>
phone2.#owner = "Harris, Phyllis"
Console.WriteLine(phone2)
'Imports <xmlns="http://defaultNamespace">
I haven't seen any way of doing this. Please go rate or comment on this suggestion on the Microsoft Connect site.
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=490740