|
Hello guys. I used following tutorial as a guide for adding/modifying a satellite assembly.
Creating Satellite Assemblies for Desktop Apps.
I am able to create
1- new .resx file
2- create a .resource file from it
3- and create satellite assembly from the .resource file.
I use following two commands for creating assemblies
1: resgen string.en-US.resx
2: al /target:lib /embed:string.en-US.resources /culture:PATH TO DEBUG\en-US\TestApp.resources.dll
I create a new folder for culture I am interested in, in the Debug folder and place the newly created satellite assembly in it. When I run it, I get the exception
Could not find any resources for the specified culture or the neutral culture. Make sure "TestApp.string.resources" was correctly embedded or linked into assembly "TestApp" at compile time or that all the satellite assemblies required are loadable and fully signed.
One thing of interest here is: if I just recompile my project then changes made are picked up. But if I don't recompile my project then running the .EXE from debug folder gives this exception. WHAT COULD BE WRONG ??? (hopefully I described well) Thanks for any input.
This world is going to explode due to international politics, SOON.
|
|
|
|
|
The exception mesage says that resources are completely missing - not only for a specific culture. I'd suggest to get the project running without satellite assemblies first, and then add them.
By the way, en-US is typically the default culture, unless you explicitely set it to something else.
|
|
|
|
|
Yes. Everything is working fine if I run it without satellite assemblies. Then I add the assemblies and run it again, it works again.
Now I make a small change in the en-US.resx file. I generate xxxx.resources file from this .resx file and xxxx.resources.dll file (satellite assembly) from the resultant .resouces file. I simply replace the old satellite assembly with the new one. It gives the said exception. Unless I recompile the project, I won't work. What am I doing wrong here?
This world is going to explode due to international politics, SOON.
|
|
|
|
|
If I understand you correctly, you do a change in the main resource of the project but don't compile it. Then you manually propagate the change to the satellite assemblies. This means your satellite assemblies contain strings that are not in the main assembly. I assume that this is the problem leading to the exception. And if you compile the project again, so that the main assembly matches the satellite assemblies again, it will work. If this is what's happening, I think the behavior is by design.
The good thing about pessimism is, that you are always either right or pleasently surprised.
|
|
|
|
|
I change something in satellite assembly ( change in .resx --> generate .resources --> generate .dll using VS command line). No change in main assembly. Do I have to recompile the whole project again ORR just updating the satellite assembly should suffice ?
In my case, I have to recompile whole project whereas I think I should just update the satellite assembly and application should run. What am I doing wrong here ??
This world is going to explode due to international politics, SOON.
|
|
|
|
|
Good Day All
i have a Windows Service written in .NET 4.5 and it is hosted on a Server where there is Office with the Version Microsoft Word 2013 15.0.4420.1017
Microsoft Office Professional Plus 2013
and my Windows Service does a Mail Merge and create Documents on fly.
On my Development machine its working nicely i have Office
Microsoft Word 2013 15.0.4719.1000
Microsoft Office Professional Plus 2013
i have given all the Permissions to the LocaLService user, the Document is not Corrupt , i can open it with no Problem and all the contents are in good shape.
So on the Server i get this Error on my logs
Word was unable to read this document. It may be corrupt.
Try one or more of the following:
* Open and Repair the file.
* Open the file with the Text Recovery converter.
and LocalService is also Part of the Administrator Group for some desperacy reason to resolve this issue.
The File Path of the Document and the Extension is Correct
C:\LetterGenerator\Section78Notice.docx
thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vimalsoft.com
vuyiswa[at]vimalsoft.com
|
|
|
|
|
Vimalsoft(Pty) Ltd wrote: Word was unable to read this document. It may be corrupt. So you need to check the file manually, to see if it is or is not.
|
|
|
|
|
I have opened the file its not Corrupt. i even installed the Service Pack1 for Office and now what is on the server version is now equal to the one on my machine.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vimalsoft.com
vuyiswa[at]vimalsoft.com
|
|
|
|
|
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
The KB article lists several things that you need to check on the server. However, there is no guarantee that you will be able to get your code to work, or that it won't suddenly stop working for no obvious reason.
You might have better luck using the Open Office XML SDK to generate your documents:
Creating Documents by Using the Open XML Format SDK Version 2.0 CTP (Part 1 of 3)[^]
(Part 2 of 3)[^]
(Part 3 of 3)[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
We're going to start with you cannot run any Office application in a service and expect it to work. It's not supported, never has been, never will be. This means you can NOT use Office Interop in your service application.
You're going to need the OpenXML SDK to manipulate Office files. So now, what were you trying to do with this document once you had it open?
modified 23-Jun-15 10:51am.
|
|
|
|
|
hi Dave Long time.
Let us start here, i have a few applications that does the MailMerge Automatically but on a click of a button. The strange this is when test the service on my machine it works , the problem is when i deploy it its a problem. i have added some log files which actually pointed to the line of code
oWordDoc = oWord.Documents.Add(ref oTemplatePath, ref oMissing, ref oMissing, ref oMissing);
Here its where i give word the Template it will use in my mail merge , i have the same code working nice in a Non-Windows Service and also on my debug on my laptop it works with no Problem.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vimalsoft.com
vuyiswa[at]vimalsoft.com
|
|
|
|
|
Vimalsoft(Pty) Ltd wrote: Here its where i give word the Template it will use in my mail merge , i have the same code working nice in a Non-Windows Service and also on my debug on my laptop it works with no Problem.
You don't understand what you're doing and what's going on. It works in your dev and testing because you're not running the code AS A SERVICE.
When you deploy the code and run it as a service, it falls on its face.
I don't know how much clearer I can be. <insert any="" office="" app="" here=""> CAN NOT BE USED IN A WINDOWS SERVICE. IT WILL NOT WORK.
What everyone is telling you is that you cannot do this as a Windows Service application. Period.
|
|
|
|
|
You have a license for Word that allows you to do this? Install it on a server and have it automated by "n" clients via a service? Must have been expensive....
|
|
|
|
|
No , i don't think one will need license for that. Because you just need to install Word and use its Component to automate Mail Merging.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vimalsoft.com
vuyiswa[at]vimalsoft.com
|
|
|
|
|
Well....I think Microsoft might disagree with you, why don't you contact their licensing department and ask? Tell them you've bought a single copy of Word that you're installing on a server so that hundreds\thousands of people can all use it remotely.
|
|
|
|
|
No one is using it remotely. Basically my serve get a Template document and get data from the DB and generate the word Document on the server. No one is accessing those documents except one person who is actually posting those documents.
i have now went the nasty to get my department working. So i have copied the same code in a Windows form application and created Schedule that will call that exe every 10 min. i will need to monitor that and see how it works for few days.
For now i think this case is closed.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vimalsoft.com
vuyiswa[at]vimalsoft.com
|
|
|
|
|
Hello guys, I have below code & I would like to combine into one method that accept generic type... possible to do that?
Thanks.
public string empName
{
get
{
object temp_result = func1(MyConst.name);
string result = Convert.ToString( temp_result );
return result;
}
}
public int empID
{
get
{
object temp_result = func1(MyConst.id);
int result = Convert.ToUInt16( temp_result );
return result;
}
}
public object empData
{
get
{
object temp_result = func1(MyConst.Data);
object result = temp_result;
return result;
}
}
modified 23-Jun-15 3:14am.
|
|
|
|
|
Do you mean "how do I write a generic function I can call from all the properties?"
If so, what's the problem?
private T func1( T param)
{
...
}
If not, then what do you mean?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
|
I want to populate a label in an Access report header, from C# using automation. The report has the following in the Load event:
Option Compare Database
Private Sub Report_Load()
Me.lblHeaderReport.Caption = Me.OpenArgs
End Sub The C# source code:
using MsAccess = Microsoft.Office.Interop.Access;
MsAccess.Application app = new MsAccess.Application();
app.OpenCurrentDatabase(
"C:\\Dev\\Databases\\SomeDatabase.mdb",
false,
"some password"
);
string strFilter = "qSomeQueryForReport";
app.Visible = false;
app.DoCmd.OpenReport(
"rptSomeReport",
Microsoft.Office.Interop.Access.AcView.acViewNormal,
strFilter,
Type.Missing,
MsAccess.AcWindowMode.acWindowNormal,
"HeaderTest"
);
app.DoCmd.Close(
MsAccess.AcObjectType.acReport,
"rptSomeReport",
MsAccess.AcCloseSave.acSaveNo
);
app.CloseCurrentDatabase();
System.Runtime.InteropServices.Marshal.ReleaseComObject(app);
app = null; Problem:
The text "HeaderTest" does not appear in the report header label. No error generated.
modified 23-Jun-15 4:08am.
|
|
|
|
|
I have program but I don't understand about source code to open some file.. Anybody help me? How to open from excel or notepad and it read on our program?
|
|
|
|
|
Sorry?
I'm not sure I understand you correctly: it sounds like you have the source code to a C# program and want to look at it, modify it, and then compile and run the result.
If so, then Excel and Notepad are both bad choices!
Go to Microsoft, and download a copy of Visual Studio (there are Express version of 2005, 2008, 2010, 2012, and a Community Edition version of 2013 - all of which are free, subject to certain conditions)
Which version you need depends on how old the source code is: you are probably best assuming you want the latest version: https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx[^]
When that's installed, double click the .SLN file that should be part of the source code and the project should open.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Can I use javascript in web forms project which has master pages and content pages. I know it can be used but the code written in script tag or style tag is not executed. I have tried too many solutions I get from sites like stakoverflow and codeproject because I am facing this problem since 15-20 days, even there is no error in the syntax. But the problem is script is not executed.
|
|
|
|
|
A couple of things.
1. This is the C# forum, so you're not going to have much luck here.
2. You haven't shown any code. No one will be able to help you identify a problem with your code if you haven't shown it.
|
|
|
|
|
Your problem is that you're not appreciating that javascript runs on the client using the rendered html, and what you see in visual studio aspx files is not what is rendered to the client. .net will change your control IDs so if you refer to IDs in your js you need to use the ClientID property of the control to get the proper ID, or use static ids if that is suitable (it won't always be);
ASP.NET 4.0 Client ID Feature[^]
Other things you need to bear in mind are code paths and how you refer to your js files in relation to your other files.
There is no single trick to this, it mainly involves having a good understanding of the framework and using best practises in your coding, and tackling individual problems as you encounter them.
|
|
|
|