I'm facing a problem with a conflict between the DateTime class and a namespace for some unknown reason was also called DateTime.
Assembly CompanyDateTime has namespace Company.DateTime
My Application is in the namespace: Company
the problem is that everytime I need to use DateTime class, I have to explicitely say System.DateTime is their any way of getting around this?
Is is possible to say SomeRandomStuff = Company.DateTime and have DateTime always be System.DateTime
Note:
Possible Resolution? Is is possible for CompanyDateTime to get automatically deployed to the output folder without adding it in the reference?
Question : the problem is that everytime I need to use DateTime class, I have to explicitely say System.DateTime is their any way of getting around this
Answer : Already answered above - use an Alias eg
using CompanyDateTime = Company.DateTime;
using StandardDateTime = System.DateTime;
Question : Is is possible for CompanyDateTime to get automatically deployed to the output folder without adding it in the reference?
Answer : Put this dll in the application root folder and create a postbuild event that copies this to the output folder. You can use the regular DOS COPY command here.
Refer link for postbuild event details
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With